Question: in java please show output 1.3.37- Josephus problem. In the Josephus problem from antiquity, N people are in dire straits and agree to the following

in java
please show output
 in javaplease show output 1.3.37- Josephus problem. In the Josephus problem

1.3.37- Josephus problem. In the Josephus problem from antiquity, N people are in dire straits and agree to the following strategy to reduce the population. They arrange them-selves in a circle (at positions numbered from 0 to N-1) and proceed around the circle, eliminating every Mth person until only one person is left. Legend has it that Josephus figured out where to sit to avoid being eliminated. Write a Queue client Josephus program (in java) that takes N and M from the command line and prints out the order in which people are eliminated (and thus would show Josephus where to sit in the circle). % java Josephus 72 1350426 N M AC

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!