This week’s module focused on algorithm design techniques and graph algorithms. I learned how divide-and-conquer is applied in QuickSort, including how pivot selection affects performance and how the Median-of-Three strategy helps avoid worst-case scenarios. I also studied decrease-and-conquer through binary search and understood why sorting first can improve efficiency. In addition, I learned about Directed Acyclic Graphs (DAGs) and topological sorting. Using Kahn’s algorithm, I practiced calculating in-degrees, identifying source vertices, and detecting cycles. The quizzes and HW4_2 helped reinforce how algorithm steps and data structures like queues affect the final output order.
This week, I focused on understanding the Merge Sort algorithm and how the divide and conquer strategy works in practice. From the lecture video, I learned that Merge Sort repeatedly splits an array into two halves until each subarray has only one element, which is already sorted. The key step is the merge operation , where two sorted subarrays are combined by comparing elements and placing them in order. Using the recurrence relation T(n) = 2T(n/2) + Θ(n) and applying the Master Theorem , I learned that the overall time complexity of Merge Sort is Θ(n log n) . This helped me connect the algorithm steps with formal time-complexity analysis.