Last Minute Notes
Github
Docs
Learn
Search
⌘
K
@sayanstwt
Lessons
Learn
/
Data Structures & Algorithms
/
Trees & Heaps
K-way Merge
7 min
Intermediate
7 steps
Merge k sorted lists with a min-heap of heads.
K
3 lists
N
8 values
Each list
sorted
LIST A
1
4
5
LIST B
1
3
4
LIST C
2
6
merge into one sorted list
current
done
skipped
In this lesson
Step 1 of 7
1
The problem
2
Heap of heads
3
Pop, push
4
Full merge
5
Matrix
6
Alternatives
7
Recap