Posts

Showing posts from September, 2025

Reflections on Algorithms

On this week’s exam, I felt confident with core topics like merge sort’s Θ(n log n), and dense graph adjacency matrices. I know I'm able to apply some foundational techniques under pressure. However, I also made some mistakes that came from missing small but important details like carefully identifying the basic operation or following traversal conventions. I need to take a step back and think about both the big picture strategy and the fine details of implementation. This week also marks the halfway point of Algorithms, and I feel like my thinking has grown. It's been both challenging and rewarding because it pushes me to break problems down logically instead of leaning on my intuition - which I often do. I need to strategize more on how I analyze loops, recurrences, and data structures. It also helps to find solutions using precise mathematical notation. Even when I get questions wrong, I view it as an opportunity to sharpen my reasoning and improve my problem solving.

Graph Adventures & Comparisons

This week I worked on two C++ programs for graph algorithms in our assignment. The first used Depth-First Search (DFS) with a stack and a mark array to show the order each vertex is visited. This helped understand how DFS explores connected vertices and why sorting each adjacency list keeps the visit order consistent. In the second part, I solved the Traveling Salesman Problem by checking all possible vertex paths to find the lowest-cost cycle. These projects were good exercises in using vectors and stacks. Aside from programming, we covered some core algorithm topics. One of them was brute-force string matching and how best- and worst-case inputs affect its runtime. As mentioned above, depth-first search was also covered along with breadth-first graph traversals. We also covered the knapsack optimization problem and its focus on maximizing value within a capacity limit. I wanted to go into more depth on DFS vs BFS. Depth-First Search is a fundamental graph-traversal algorithm that...

Finding a Balance with Efficiency

This week’ we covered Brute Force and Divide-and-Conquer. Brute-force methods try every possibility to find a solution. On the other hand, Divide-and-Conquer breaks a problem into smaller subproblems, solves each independently, and combines the results. This strategy is more efficient. Homework 2 pushed me to implement programs to reinforce these concepts. The first part asked for finding the closest distance between two input numbers. The second part required sorting a set of unique positive integers and displaying consecutive numbers in a compressed range format. Both demanded attention to detail for the handling of input and algorithm correctness. In summary, it's important to understand efficiency. Brute-force approaches guarantee correctness. However, they are not practical for large inputs. Divide-and-conquer provides more of a balance with its simplicity and efficiency.

The Art of Efficiency and Algorithms

 This week we covered concepts, like Big-O, searching, sorting, and trees. Having a little brush up made this weeks problems easier to solve. Working through the word problems was a bit challenging, but also rewarding. It forced me to think about different possible approaches and carefully think about which ones were the most efficient. At first, some solutions seemed intuitive, but when I tested them, I realized they weren’t always the best or most optimal. It seems that problem solving in algorithms may sometimes involve moving past the obvious answer and considering strategies that are not as straightforward, but more effective. It’s important to balance intuition with logical analysis. I gained a deeper appreciation for how creative and analytical thinking work together to solve problems.  I’m looking forward to the rest of this course because it reminds me of the balance I’ve always admired in music between technical skill and creativity. As a musician from an early age, ...