Write a method that has two linked list head references as parameters. Assume that linked lists contain

Question:

Write a method that has two linked list head references as parameters. Assume that linked lists contain integer data, and on each list, every element is less than the next element on the same list. The method should create a new linked list that contains all the elements on both lists, and the new linked list should also be ordered (so that every element is less than the next element in the list). The new linked list should not eliminate duplicate elements (i.e., if the same element appears in both input lists, then two copies are placed in the newly constructed linked list). The method should return a head reference for the newly constructed linked list.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: