Data Structures19 sections · 729 units
Open in Course

Quiz: K-Way Merge

Complexity analysis

Check Your Understanding

When merging k sorted lists with n total elements, why is the heap approach O(n log k)?

  1. A.Because we sort n elements k times
  2. B.Because the heap has at most k elements, and we do n insertions/extractions
  3. C.Because we compare each element to k others
  4. D.Because we merge lists in pairs log(k) times
Start the roadmap to answer the quizzes and solve the challenges