Concept Flow - K-way merge with heaps
Start with K sorted lists
Insert first element of each list into min-heap
Extract min element from heap
Add extracted element to merged output
Insert next element from same list into heap if exists
Heap empty?
No→Repeat extract and insert
Yes
Done: merged sorted list
Start by putting the first element of each sorted list into a min-heap. Then repeatedly extract the smallest element, add it to the output, and insert the next element from the same list until all lists are merged.