Create an application in c that uses a linked list to


Assignment - Josephus Problem - Linked Lists

Objectives:

• Fully implement an linked list from scratch
• Show understanding of using algorithms of a linked list

o Dynamic allocation
o Deletion
o Etc.

• Use Object Oriented skills to create a templated linked list class

Outcomes:

• Understand structured programming techniques in-depth.
• To learn data abstraction and object-oriented programming.
• To learn the fundamental data structures including stacks, queues, linked lists, and trees.
• To obtain a good foundation for further study in computer science.

Description:

Josephus Problem

"There are people standing in a circle waiting to be executed. After the first man is executed, certain number of people are skipped and one man is executed. Then again, people are skipped and a man is executed. The elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last man remains, who is given freedom.

The task is to choose the place in the initial circle so that you survive (are the last one remaining)."

-- Wikipedia, https://en.wikipedia.org/wiki/Josephus_problem

Assume that the number of people, P, in the circle may be any number between zero and one hundred.

Assume that every Nth person around the circle is killed each turn, where N is an integer between one and twenty.

Specifications:

• Create an application in C++ that uses a linked list to represent the circle of people, numbered from 1 to P.
• Acquire the values P and N from the user at runtime via console input.
• Output the the individual that survives the mass execution.

Flash Version

• https://webspace.ship.edu/deensley/flash/JosephusProblem.html

There are several Java applet versions of this problem to check your work as you debug.

• https://www.wou.edu/~burtonl/josephus.html

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Create an application in c that uses a linked list to
Reference No:- TGS01490125

Now Priced at $40 (50% Discount)

Recommended (93%)

Rated (4.5/5)