merge-k-sorted-arrays

JSON →
library 3.0.0 ·javascript
verified Jun 7, 2026

Efficiently merges 2 or more sorted arrays using a priority queue (min-heap). Version 3.0.0 requires Node.js >=20. Ships TypeScript types. Key differentiators: supports custom comparator, output metadata (array index and value index), and deduplication via unique option. Uses a heap-based approach for O(n log k) time complexity. No external runtime dependencies.