Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
You can solve the Josephus' problem with a circular linked list, see the link attached. Basically, every "player" is a list node and "skipping" one node (breaking and reconnecting the "->next" link) means playing one turn. https://www.geeksforgeeks.org/josephus-circle-using-circular-linked-list/
22nd Sep 2020, 2:05 PM
Mihai Iacov
Mihai Iacov - avatar