K-way-merge

3 articles

dsa2 min read

Merge K Sorted Lists

Merge K sorted linked lists into one sorted list using a min-heap to always extract the globally smallest node.

Read →
dsa2 min read

Find K Pairs with Smallest Sums

Find K pairs (u, v) with smallest sums from two sorted arrays using a min-heap initialized with first row candidates.

Read →