Question: a ) ( 2 pts ) Given two sorted singly linked lists, define a method merge that merges the given lists into a third one
a pts Given two sorted singly linked lists, define a method merge that merges the given lists into a third one that will also be sorted and contains the duplication of the elements.For example, if the first list contains and the second contains the result should be If one of the given lists is empty, your method should return the head reference of the other list.Possible header:public static NODE mergeNODE headi, NODE headhead and head are the heads' references to Ithe first and the second lists respectivelyb pt Determine the time complexity of your method using the BigTheta notation in terms of m and n the lengths of the lists.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
