The collections class which has an algorithm called


if you have linkedlist of [1,2,3,4,5].use in java the Collections class which has an algorithm called rotate(List list, int distance) which can be used to rotate a list left or right. use to eliminate every other Integer beginning with the Integer in the second position. Remember that if you remove an item in the middle of the list, the items which follow it are shifted forward in the list.Continue eliminating integers until a single Integer is left. Print the list for each step in this process and the survivor's position.

As an example of this process, if we represent five men with a list of integers, [1,2,3,4,5], rotate the list to the left and remove the first man each time, we would see lists like this:

[1, 2, 3, 4, 5]

[3, 4, 5, 1]

[5, 1, 3]

[3, 5]

[3]

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: The collections class which has an algorithm called
Reference No:- TGS01009614

Expected delivery within 24 Hours