Week 7 (2/18-2/24)
This week's content had a lot of topics and algorithms to cover. These are some of the concepts I learned this week:
Counting Sort: Count how many times each value appears (frequency), then build the cumulative distribution to place items in sorted order.
Radix Sort (LSD): Sort numbers digit by digit starting from the least significant digit (ones place), using a stable sort each pass.
Dynamic Programming (DP): Solve problems by storing results of smaller subproblems and building up to the final answer.
Coin-Collecting Problem: In a grid, find the maximum coins collectable when moving only right or down using a DP table.
Coin-Row Problem: Choose coins in a row to maximize value without taking adjacent coins
Warshall’s Algorithm: Finds the transitive closure of a graph (reachability: whether a path exists between vertices).
Floyd’s Algorithm: Finds all-pairs shortest paths by updating distances with intermediate vertices.
Greedy Method: Build a solution step by step by always choosing the best local option at the moment.
MST (Minimum Spanning Tree): Connect all vertices in a weighted graph with the minimum total edge weight and no cycles.
Prim’s Algorithm: A greedy MST algorithm that starts from one vertex and repeatedly adds the smallest edge connecting the current tree to a new vertex (weights matter first; alphabet only breaks ties).
No comments:
Post a Comment