Merge unsorted linked lists

Write the algorithm to merge two unsorted linked lists.

Answer:[1]



The bucket sort will give the best performance.

Add both the linked lists to a bucket data structure and then its simple to perform the bucket sort.

The complexity depends on the input values and how well they can be uniformly distributed among the buckets.


No comments: