Week 5 Learning journal- CST370
This week's module focused on the practical application of the Divide and Conquer strategy through Quicksort and the logic of dependency management using Topological Sorting. Quicksort is an efficient, in-place sorting algorithm, which means it sorts the input array without requiring significant additional storage. A key component of its performance is the partitioning process, where a pivot is selected to split the array into two subarrays. I learned that using a Median-of-Three pivot selection is a common technique to avoid the worst-case time complexity of O(n^2) that occurs when the input is already sorted. The study of graph algorithms introduced Topological Sorting specifically for Directed Acyclic Graphs (DAGs). Using Kahn's Algorithm, I explored how to order vertices linearly based on their in-degrees. This process involves identifying vertices with an in-degree of zero, adding them to a queue, and then updating the in-degrees of their neighbors as they are processed. T...