Min heap problem
Recall this problem -- define an algorithm that will merge k sorted lists into one sorted lists in O(n lg k) time where n is the number of elements in ALL the input lists...
My question is why do we define a comparison that states the following:
"We shall also need to define comparison with empty lists, and so we define it taking that any non-empty list is smaller than the empty list."
when we already established this:
"Now let us take our k sorted lists (of arbitrary lengths) and define the comparison between the lists by their smallest elements."
By OTA: Israel Kovner, PhD
OTA Rating: 5/5
Your Price: $2.19 (original value ~$3.99)
What's included:
Page generated in 0.0126 seconds