Sunday, 23 March 2014

Week 10: Sorting Algorithms and Assignment 2

    More talk about performance, efficiency, and sorting algorithms were present in this week's lectures. This time, new O(n lg n) algorithms were introduced: the quick sort and merge sort. The quick sort, uses a pivot and partitions the array into two, one less than the pivot and one greater. This process is done recursively to the partitions and eventually, the array becomes sorted. The merge sort first splits an array so that the new arrays only has one of each elements. Then a pair of the new arrays are merged while sorted. This process is repeated until the partitions of the arrays become one again, which would be sorted.

    The labs are becoming not so easy these days. I now am worried the upcoming test would be quite challenging, especially since only 50 minutes are allowed to write it. Part 2 of the Assignment was due on Thursday. The functions, is_regex, all_regex_permutations, and build_regex_tree, were pretty straight forward I though and hopefully, my partner and I coded correctly. However, regex_match was difficult. The algorithm for matching star trees was the hardest. Although we created what seems to be a possible algorithm, our code did not work properly for matching them so perhaps the idea was wrong or maybe its just that we did not implement them correctly. I hope all goes okay for this assignment, which was not easy.

No comments:

Post a Comment