@DanielFischer Could I ask you something about an algorithm?
I want to write a $O(n \lg k)$-time algorithm in order to merge k sorted lists into one sorted list, where n is the total number of the elements in all the input lists.
I thought the following:
We put in a min-heap of length k the first elements from the k sorted lists.
Then, we heapify and delete the root , which will be the smallest element and put it at a new list, and at this position we put the second element from the list from which the smallest element came from. Then we heapify and continue the same procedure till the li…