Question: Write a Java program ( application ) without using the built in linkedlist java class which given two unsorted lists, merge their nodes together to

Write a Java program (application) without using the built in linkedlist java class
which given two unsorted lists, merge their nodes together to make one list, by taking nodes alternately between the two lists. For example, if list1 contains [1,5,3] and list2 contains [7,13,1] then they will be merged into list3 which would look like [1,7,5,13,3,1]. If either list (list1 or list2) runs out of nodes, then all the nodes in the other list should be added to list. Write a method main to test this method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!