Use a circular list to implement the josephus problem

Assignment Help Other Subject
Reference no: EM131468046

Use a circular list to implement the Josephus Problem. In the Josephus Problem, there is originally a circle of people numbered from one to n. Some number is chosen as the starting person, and an interval of size m is selected. Then, starting at the chosen person, every mth person is eliminated until only one person remains. The output should be a list of the eliminated people in the order of elimination, and a statement of which person remains. Do this once with the circular list class implemented with nodes and pointers and once as a circular array with some method of designating a person as "not there." The two implementations of the circular list should be designed to require no change to the code outside the circular list class. Both circular list classes should have functions AdvanceN(n) and DeleteThis(x), where AdvanceN(n) returns a new position in the list that is n places further on, and DeleteThis(x) deletes person x and returns the position previous to x.

Reference no: EM131468046

Questions Cloud

Different organizational cultures develop in the four claims : How do different organizational cultures develop in the four claims' offices of the same insurance company,
Why is the crowd a problem according to kierkegaard : Why is the 'crowd' a problem according to Kierkegaard? Why is the 'seriousness' of the individual opposed to the 'crowd'
Create a prospecting strategy : You have been hired as a consultant by a new company to develop a strategic prospecting strategy. Create a prospecting strategy.
What was the lawsuit and who filed the lawsuit : What was the lawsuit and who filed the lawsuit? What was the decision of the court? Do you think the statute is fair and lawful for today?
Use a circular list to implement the josephus problem : Use a circular list to implement the Josephus Problem. In the Josephus Problem, there is originally a circle of people numbered from one to n
Find the minimise the cost of given rod : There is a rod of length N lying on x-axis with its left end at x = 0 and right end at x = N. Now, there are M weak points on this rod denoted by positive.
Describe some of the threats to your personal security : Describe some of the threats to your personal security. Describe what you can do to better protect your personal security.
Destroyed by an earthquake : Your manufacturing facility in Mexico has been destroyed by an earthquake. what tax implications must be considered regarding the potential move to China?
Find the critical path : Find the critical path.What is the project completion time?

Reviews

Write a Review

Other Subject Questions & Answers

  Provide comfort care at the end of life

Providing Comfort Care at the End of Life. The National League of Nursing (2011) suggests competencies for the nurse educator that assist in promoting excellence in their practice.

  Specific need area to explore-drug abuse as problem

Introduction to your paper and thesis statement with specific objectives stated - i.e. - what you intend to explore  8 - 10 pages (excluding title and reference pages), supported with reference articles, with the following subheadings to explore yo..

  Significant financial distress in the banking system

In the past decade or more significant financial distress in the banking system of one economy has given rise to vulnerability and distress in the banking systems of other economies. Discuss this issue with respect to one of the following countrie..

  Drug laws infringe on peoples rights to dictate own behavior

Some say that drug laws infringe on peoples’ rights to dictate their own behavior. Should people be free to engage in behaviors, like drug use, as long as they do not infringe on the rights of others?

  Political community as presented by john locke

Explain the circumstances that justify resistance to the duly constituted authorities in the political community as presented by John Locke.

  Write on a topic that makes the naval profession stronger

Write on a topic that makes the naval profession stronger. Identify opportunities to better use enlisted professionals' talents. Share leadership best practices. Improve tactical doctrine.

  What do you make of the feminist of the essentialist

What are some of the differences/similarities between the avocado and artichoke views of the self?What do you make of the feminist, existential, and non-Western critiques of the essentialist/avocado self? Are there any other problems with the idea..

  Arafat and middle east peace

Examine the career of Yasser Arafat as a leader of the PLO, and his contributions to, or against, peace with Israel and where the PLO now stands in the region.

  Use analysis of variance to test for any significant

suppose that a local chapter of sales professionals in the greater san francisco area conducted a survey of its

  Information technology and information systems important

Why is the difference between information technology and informationsystems important?

  What happened to malinski after the confession

What happened to Malinski after the confession? What does it tell us about policing before miranda

  Describe how the project featured in the video demonstrates

Reflect on the video you selected and viewed from the DVD that accompanies your course text. Describe how the project featured in this video demonstrates at least two of the digital literacy skills described in your readings

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd