Week 53 (2/4/2026 - 2/10/2026)
(Click on READ MORE for better formatting)
Hi everyone, welcome to my 53rd blog! This is the Week 5 post for CST 370 Design and Analysis of Algorithms.- Weekly learning journal relevant to this week's module. (50 words)
- This week, we continued our discussion on sorting algorithms such as Quick Sort and Insertion Sort. Additionally, we also discussed binary search trees along with its traversal techniques. Finally, I was also introduced to the decrease-and-conquer approach which is commonly used for topological sorting (Kahn's algorithm).
- There was also a homework assignment this week that tasked me to write two programs:
- 1. Write a program that generates an array and compares the operation times between Quick Sort, Quick Sort with Median of Three, and Insertion Sort. Since Quick Sort has a complexity of O(n log n) compared to Insertion Sort's O(n²), we expect quick sort to typically yield superior results except in a few cherry-picked scenarios where insertion sort outperforms.
- This assignment required a bit of a different setup compared to previous ones. Instead of receiving input with test cases, this particular program requires manual testing using a Scanner(System.in) or std::cin interface, depending on the language used. I have been writing these projects in Java.
- 2. Write a program that conducts topological sorting based on the Kahn algorithm covered in class.
- While there was no pseudocode provided for this project, a blend of lecture material and AI was very helpful when completing this one.
- Finally, I also contributed this video to our course's official Discord server: https://www.youtube.com/watch?v=7J3GadLzydI. It visualizes and explains topological sorting with an example.
That is all for this week, see you in my Week 54 post!
Comments
Post a Comment