Concepts5
βοΈAlgorithmIntermediate
SPFA (Shortest Path Faster Algorithm)
SPFA is a queue-based optimization of BellmanβFord that only relaxes edges from vertices whose distance just improved.
#spfa#bellman-ford#shortest path+12
βοΈAlgorithmIntermediate
0-1 BFS
0-1 BFS is a shortest path algorithm specialized for graphs whose edge weights are only 0 or 1.
#0-1 bfs#binary weights#shortest path+12
βοΈAlgorithmIntermediate
Sliding Window
Sliding window is a technique that moves a contiguous segment (window) across an array or string while maintaining some running information like sum, count, or max.
#sliding window#two pointers#variable window+11
ποΈData StructureIntermediate
Queue and Deque
A queue is a First-In-First-Out (FIFO) line where you add at the back and remove from the front in O(1) time.
#queue#deque#fifo+12
ποΈData StructureIntermediate
Monotonic Deque
A monotonic deque is a double-ended queue that keeps elements in increasing or decreasing order so that the front always holds the current optimum (min or max).
#monotonic deque#sliding window maximum#sliding window minimum+12