Posts

Showing posts from January, 2026

Learning journal Week 3- CST370

This week I was learning and reading about the foundational concepts of algorithmic design, specifically Brute Force methodologies. I explored how these approaches, while conceptually straightforward, provide a comprehensive way to solve optimization problems by evaluating every possible solution. I also went through the examples like the Traveling Salesman Problem (TSP) and the Knapsack problem.  The homework (HW3) was a great way to put this into practice. For the DFS part, I had to be careful with sorting the adjacency list to make sure the stack processed neighbors in the correct numerical order. It was a good reminder that the data structure details really matter. Then for the TSP program, generating all those permutations to find the cheapest path really proved the point about how computationally expensive exhaustive search is. It was satisfying to finally get the correct path costs after reviewing the logic for a bit. I also looked into the theory side of Graph Traversal and...

Week 2 Learning Journal - CST370

This week covered asymptotic notations and algorithm analysis, which felt math-heavy at first but started making sense once I applied it to my homework. The textbook reading explained the three main notations: Big-O for worst-case upper bounds, Big-Omega for best-case lower bounds, and Big-Theta for when both are the same. I found the Theta notation video helpful because it showed concrete examples of when to use each one. The best part of this week was seeing how analysis applies to real code through both homework problems. HW2_1 (Closest Pair Problem): I needed to find the minimum distance between any two numbers in an array. The brute force approach would compare every pair, which takes quadratic time. Instead, I sorted the array first and then scanned consecutive elements. This is much faster because sorting takes n log n time and scanning takes linear time. After sorting, the minimum distance must be between adjacent elements, so I only needed one pass through the array. HW2_2 ...

Learning journal Week 1- CST370

This first week was a solid refresher. I started by watching the video on Euclid's algorithm for GCD. It was insightful to compare it against the basic consecutive integer checking method because it proved that brute force is not always the best answer. Sometimes a simple mathematical insight saves more time than a faster computer ever could. I also worked on Homework 1 this week. The assignment asked us to check for palindromes while ignoring symbols and case. I chose to create a new filtered string with only alphanumeric characters first. It was a good exercise, but it made me think back to the Algorithm Analysis Framework videos. Since I created a new string, I effectively used extra memory space. This connects directly to the space and time tradeoffs mentioned in the syllabus. I also spent some time reviewing the Graph representations and Trees videos. I realized I need to be careful about choosing between adjacency matrices and lists depending on whether the graph is weighted ...