Over the course of this week, we started covering material about the "big-oh" in lectures. The so-called "big-oh" refers to the running time of different algorithms. The most common analysis of "big-oh" performance is in different sorting algorithms, as I will cover in depth on week 11. The different efficiencies of Python algorithms depend on the function's running time, which include constant, logarithmic, linear, and quadratic, among others.
Some of the different types of sorting algorithms that we went over in lecture this week included insertion and selection sorts, which we had already learned about in CSC108 so it was mostly review material for most of the students.
This week's lab was particularly straight-forward as it involved writing the method count_less for the class of binary search trees in several different ways. The first way was by writing a nested helper function within method count_less, and this was very easy as we were allowed to make use of recursion. Other ways included having to not use None as well as implementing a helper method in the class _BSTNode. The hardest way we had to write this method was the last; we were expected to write the method non-recursively by instead making use of iterations. Surprisingly, this task was very uncomplicated and easy to understand as my partner and I utilized a for loop.
No comments:
Post a Comment