23 Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
其实有3种做法,用heap,用divide & conquer和两两merge。这里只写了用heap,其他做法请参照九章答案。T: O(nlogk)
Last updated
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
其实有3种做法,用heap,用divide & conquer和两两merge。这里只写了用heap,其他做法请参照九章答案。T: O(nlogk)
Last updated