Question: concatenate Implement a method which takes two LinkedIntLists as input and returns a new list containing all the items of the first followed by all

concatenate
Implement a method which takes two LinkedIntLists as input and returns a new list containing all the items of the first followed by all the items of the second. Dont modify the input lists; use the new keyword to create new objects instead. Your implementation should run in linear time i.e. without the use of nested for-loops.
list1: front ->1->2->3->/
list2: front ->4->5->6->/
If you made the call concatenate(list1, list2), then it should return a new list:
return: front ->1->2->3->4->5->6->/
and list1 and list2 would remain unchanged:
list1: front ->1->2->3->/
list2: front ->4->5->6->/

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 Databases Questions!