CST 370 - WEEK 5
This week, we dug deeper into quicksort, focusing especially on how partitioning works and why it’s so essential to the algorithm. We also learned the Median‑of‑Three Partitioning method, where the pivot is chosen by taking the median of the first, middle, and last elements. After arranging those three values in ascending order, the algorithm proceeds with partitioning as usual. Seeing how this improves performance on certain inputs helped me understand why pivot selection matters. We also reviewed the different ways to traverse a binary tree: In‑Order (Left, Root, Right), Pre‑Order (Root, Left, Right), Post‑Order (Left, Right, Root) It was helpful to see how each traversal reveals different structural information about the tree. Beyond quicksort, we explored more sorting and problem‑solving strategies, especially Decrease and Conquer. The idea is to reduce a problem to a smaller instance, solve that smaller instance, and then extend the solution back to the original problem (ex: to...