Write a C++ program to solve the Josephus problem for general values of m and n using circular linked list data structure.
Input:
- Number of People: n
- Number of Passes: m
Output:
- Order in which people are removed
- The survivor
Sample Run:
Enter total number of People playing the game: 10
Enter number of Passes: 3
----------------------------------------------------
Game Started!
----------------------------------------------------
à Person removed: 4
à Person removed: 8
à Person removed: 2
à Person removed: 7
à Person removed: 3
à Person removed: 10
à Person removed: 9
à Person removed: 1
à Person removed: 6
----------------------------------------------------
ààà The survivor is : 5
----------------------------------------------------
Solution day dooo bhai !!!!!!!
ReplyDeletewhere is solution ??????
ReplyDeleteye kia bakwas hay yar koi solution tao hay nahin yahan.
ReplyDelete