This week, we studied a more advance binary tree structure: the
binary search tree. I believe the binary search tree is more efficient when
inserting and deleting nodes, just as binary search is more efficient than
linear search. In addition, we also learned about running time analysis. I
really appreciate how Professor Danny Heap decided to go through the running time analysis section now, because
in CSC165, Professor Tom Fairgrieve is also teaching us how to analysis the
efficiency of a program by checking the average number of steps, the maximum
number of steps (worst case), as well as the minimum number of steps (best
case). I found it easier to understand the concept of running time analysis
because both professors are teaching closely related material, and I am able to grasp
the idea behind better.
As for assignment 2, I found it shorter
compare to assignment 1. It also takes less understanding of the program when
coding. For instance, in assignment 1, I have to first understand what each
class or method does, then proceed to coding the class or method. I remember I
took a long time to understand the "add" method in assignment 1
because I did not know what it is supposed to do. However in assignment 2, the
instructions are pretty clear and the programming part wasn't that hard.
Nevertheless, I did have trouble with matching a string with a regular
expression that contains the "*". As stated in the assignment 2
guidelines, "A regex of the form r + '*' matches string s if.....s has the
form s1 + s2 +......+ sk
where k > 0 and r matches every si". I had problem determining where to
cut the string s such that each components will match the regular expression.
My friend and I are stilling working on regex_match star node part. Hopefully
we will manage to figure it out!
No comments:
Post a Comment