Greedy Algorithm
Everything on SkillVeris tagged Greedy Algorithm — collected across the glossary, study notes, blog, and cheat sheets.
8 resources across 1 library
Interview Questions(8)
What is Dijkstra’s Algorithm?
Dijkstra’s algorithm finds the shortest path from a single source vertex to every other vertex in a weighted graph with non-negative edge weights, using a gree…
Greedy vs Dynamic Programming: What is the Difference?
Greedy algorithms make the locally optimal choice at each step and never reconsider it, while dynamic programming explores overlapping subproblems and combines…
Coin Change Problem: How Would You Solve It?
The coin change problem (minimum coins to make an amount) is solved with dynamic programming: dp[a] holds the fewest coins needed to make amount a, computed as…
What is Kruskal's Algorithm?
Kruskal's algorithm builds a minimum spanning tree by sorting all edges by weight ascending and greedily adding each edge that connects two previously disconne…
What is Prim's Algorithm?
Prim's algorithm builds a minimum spanning tree by growing a single connected tree from an arbitrary start vertex, at each step adding the cheapest edge that c…
What is the Graph Coloring Problem?
Graph coloring assigns a label, or color, to every vertex of a graph so that no two adjacent vertices share the same color, and the goal is usually to do it wi…
What is a Minimum Spanning Tree?
A minimum spanning tree (MST) is a subset of a connected, weighted, undirected graph's edges that connects every vertex together, contains no cycles, and has t…
What is SSTF Disk Scheduling?
Shortest-Seek-Time-First (SSTF) disk scheduling always services the pending request whose cylinder is closest to the disk head’s current position, greedily min…