CST370 - Week 2
- YZ

- Mar 16, 2021
- 1 min read

This week, we started off continuing our topic of asymptotic notations. We learned that the Big-Oh notation serves as an upper bound, Big-Theta as the average bound, and Big-Omega as a lower bound. We then went on to discuss recursive algorithms. We learned how to determine the base case, recursive case, and recurrence relation to figure out the time complexity of the algorithm. In this module, we were introduced to the famous Tower of Hanoi problem (pictured above) and were shown how to solve it using recursion. Next, we reviewed the brute force approach to solving problems. This approach aims to solve the problem in the simplest, most straightforward way possible without giving thought to efficiency or other factors. Two examples of the brute force approach are Selection Sort and Bubble Sort.
For our homework, we were assigned to write 3 programs. The first program reads two timestamps and displays the difference between them. The second program determines the maximum possible number of apples in boxes without counting two full boxes next to each other. The last program converted directed graph data into an adjacency list. I was able to complete all three programs and also submitted the quiz, which required a lot of time and thought.


Comments