CST370-Week3

This week I finally wrapped my head around DFS and BFS. At first, the stack versus queue thing seemed arbitrary, but now I get why they explore graphs differently. DFS goes deep before backtracking, while BFS checks all neighbors first. The implementations are pretty similar once you understand the core pattern.

We also covered brute force algorithms like the traveling salesman problem. Generating all permutations to find the optimal solution is wildly inefficient, but it guarantees you'll find the answer. It's satisfying to see these fundamental approaches work, even if they don't scale well for larger inputs.

Comments

Popular Posts