Algorithm 3 Merge Sorted Lists
Input: sorted lists with elements in total
Output: A sorted list of size
1:extract the first element from each sorted list to form
2:
3:BuildMinHeap()
4:let be the result list
5:while do
6: HeapExtractMin()
7:let be the list which came from
8:if is not empty then
9:extrace the first element from
10:MinHeapInsert()
11:end if
12:append to
13:end while
14:return