CST 370 - Week 3
Hey everyone!
This week was packed with foundational concepts in computer science and algorithm design. From string matching to exhaustive search strategies and graph traversal techniques, I gained a clearer understanding of how various algorithms work under the hood and how they can be applied to solve complex problems. Here's a breakdown of what I learned:
I started the week exploring Brute Force String Matching, one of the simplest ways to find a pattern within a larger text. The method checks for a match by comparing the pattern to every possible position in the text. While it's not the most efficient, it’s a great way to understand the basics of string comparison and sets the stage for more advanced algorithms. The video walkthrough helped solidify how this method operates step-by-step.
I then moved on to Exhaustive Search strategies, which involve exploring all possible solutions to find the best one. Three classic problems were covered:
-
TSP (Travelling Salesman Problem): I learned how brute-force methods enumerate all possible paths to find the shortest route—a good example of combinatorial explosion.
-
Knapsack Problem: Showed how all combinations of items are considered to maximize value without exceeding weight.
-
Assignment Problem: Illustrated how each task-person pair is evaluated to find the optimal assignment.
The corresponding textbook readings (pages 115–120) gave a more formal explanation, reinforcing my understanding of the trade-offs between accuracy and efficiency.
Next, I explored DFS, a graph traversal technique that dives deep into each branch before backtracking. It was fascinating to see how it can be used in solving puzzles (like the Fake Coin problem) and pathfinding. The videos and the exercises really helped me grasp the recursive nature of DFS and its time efficiency implications.
In contrast to DFS, BFS explores all neighbors at one level before moving to the next. I learned how BFS can be used for shortest path problems in unweighted graphs. The BFS exercises provided hands-on practice and made the abstract idea much more tangible.
Toward the end of the week, I delved into Divide and Conquer, a paradigm that breaks a problem into smaller sub-problems, solves them independently, and combines their solutions. The Master Theorem was a bit challenging at first, but the video explanation and exercises helped me understand how it’s used to analyze time complexity.
The Fake Coin and Finger Count puzzles were fun and thought-provoking. They challenged me to apply algorithmic logic creatively, reinforcing the concepts from lectures.
This week was intense but incredibly rewarding. I now better appreciate the balance between algorithm simplicity and computational efficiency, and I’m beginning to recognize patterns in problem-solving strategies. Each topic built on the last, showing how foundational algorithms interconnect and support more complex logic in computing.
Looking forward to next week’s challenges!
Comments
Post a Comment