Interactive visualizations demonstrating different data structures and algorithms for merging multiple sorted streams.
A simple approach that scans all K candidates at each step to find the smallest. Serves as the baseline for comparison.
O(K) per stepUse a binary Min-Heap to select the smallest element.
O(log K) per stepUses a tournament tree where the smallest element rises to the root through a series of matches at each level.
O(log K) per step (less comparisons)A variation of the tournament tree where losers are stored at internal nodes, simplifying the replay path to the root.
O(log K) per step (less comparisons, less memory accesses)