Concepts3
βοΈAlgorithmIntermediate
Think Backwards (Reverse Thinking)
Think Backwards is a problemβsolving pattern where you reverse time or direction so hard deletions become easy insertions and the final state becomes the starting point.
#think backwards#reverse thinking#offline queries+12
βοΈAlgorithmIntermediate
Dijkstra's Algorithm
Dijkstra's algorithm finds shortest path distances from one source to all vertices when all edge weights are non-negative.
#dijkstra#shortest path#greedy+11
βοΈAlgorithmIntermediate
Greedy - Exchange Argument
The exchange argument proves a greedy algorithm is optimal by swapping out-of-order choices in any supposed optimal solution until it matches the greedy one without making it worse.
#greedy#exchange argument#pairwise swap+12