Question: Java This time you are asked to create a program that given two positive numbers: the number of people in the circle. the elimination number,
This time you are asked to create a program that given two positive numbers: the number of people in the circle. the elimination number, for example, if this number is exactly two we eliminate every second person. determines the survivor's number. Suppose there are 10 people in a circle and the elimination number is 2 then we proceed as follows: Start with the list 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and initial position at 1. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 then 5 survives
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
