Week 2
Weekly Learning Journal: Algorithm Analysis & Recursion
This week, my study focused on the Algorithm Analysis Framework, specifically the formal application of asymptotic notations ($O$, $\Omega$, and $\Theta$). While I previously had a surface-level understanding of Big-O, this module challenged me to define the tight bounds of an algorithm's efficiency using Big-Theta. I learned that while Big-O provides a worst-case "ceiling," Big-Theta is often more useful for describing the actual growth rate of non-recursive loops, such as those found in standard sorting or searching algorithms.
A significant portion of my time was dedicated to the analysis of recursive algorithms. This was a step up in complexity from non-recursive analysis because it requires setting up a recurrence relation. I practiced the backward substitution method, which involves expanding the recursive calls until a pattern emerges that can be expressed as a summation. For example, seeing how a simple recursive factorial function or a "decrease-by-one" algorithm results in a linear $O(n)$ complexity was a great way to bridge math and code.
Additionally, the module’s focus on Brute Force design helped me realize that while these algorithms are often the most straightforward to implement, they serve as a crucial baseline for efficiency. I explored how simple iterative solutions for problems like selection sort or string matching rely on nested loops, which we can easily analyze using the summation rules learned in class.
Finally, the 4-Gallons Water puzzle was an excellent exercise in logical state-space modeling. It forced me to think about all possible transitions between states, which is a foundational concept for the graph-based algorithms—like DFS and BFS—that we are beginning to explore in the following week. Overall, this week reinforced that a strong mathematical foundation in recurrence and summation is vital for predicting how an algorithm will perform before a single line of code is even executed.
Comments
Post a Comment