Dijkstra's Algorithm as Greedy
Updated Apr 28, 2026
Short answer
Greedily picking the node with the current shortest path to explore next.
Deep explanation
Medium-level greedy problems often involve sorting or priority queues. Greedily picking the node with the current shortest path to explore next.
Real-world example
Merging sorted logs from multiple microservices.
Common mistakes
- Using 0/1 Knapsack logic for Fractional Knapsack.
Follow-up questions
- Why use a Heap?