[SOLVED] ADS - Solving the Josephus problem with circular lists.  

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

You are going to implement a program that provides the solution of the Josephus problem (see the description on the class slides). You are going to implement:

  • A circular list. It should have at least the following functionalities: insert a new element, print all elements, remove an element, list third element from given one. Data should be private, and accessible from the main program only through calling member functions.
  • You have freedom to the design of the program
  • The main program will use the provided functionality to answer the following question: suppose we start the process from a given node i. Which is the last node to survive ?

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.