Get in touch with us
Send us an e-mail
Question
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.
· Solve without using a Template
· there are two parts to this question - Do this once with the circular list class implemented with nodes and pointers and once as a circular array (do not use pointers here. Integers will work fine) with some method of designating a person as "not there."
· The program should allow the user to cin >>startingPerson and cin>>intervalSize
The class(es) should be declared in a separate .h file(s).
Summary
The question belongs to Computer Science and it discusses about writing a program in C++ which implements Josephus problem. Josephus problem is a classical problem on counting out people. This problem has been implemented and solved using C++ program.
Total Word Count NA
The object oriented programming languages like C++ and Java were a nightmare for me and my professor rushed off with her lectures so fast that I couldn’t catch up with the syllabus. Then once HwA started helped me out with my programming homework I got more time to understand how the things summed up.
The concepts surrounding kinetics and dynamics in chemical engineering often confused me in my initial days, till I came across HwA. Their team of online chemical engineering assignment experts helped me through the course by letting me get excellent grades in all of my assignments. And the best part is that because the tutors are from Singapore itself there is no gap in the communication between us.
Structuring the arguments while analyzing the Civil Rights movement in America, for my term paper, was bit of a challenge for me. I was unsure of how to proceed or gather information. Researching and then jotting the entire thing down needed certain help and I got that them from HwA. Here the experts not only helped me pinpoint some topics to write but also did a marvellous job in researching and helping out with the entire assignment. It is needless to say that I received excellent grades from my term paper advisor in college.
I never faced any problem with marketing management or finance. But with location strategy, I always suffered with the PERT and CRM based problems. I was unable to understand the concept of location strategies. When I came across HwA, I was relieved as they helped me overcome the horrors of location strategy and transformed my fear into a genuine interest.
1. While solving a case study on nursing ethics I was confused as in what stand to take. I did not have any idea what should have been an ideal solution to the given problem. Then when I approached TheReliableTutor.com, I found out that their online nursing tutors are actually working professionals and they gave fantastic explanations.
Comments
this is a very good website
I have 50 questions for the same test your page is showing only 28
hi can you please help or guide me to answer my assignments. thanks
hi can anyone help or guide me to my assignments. thanks
This solution is perfect ...thanks
Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes
Perfect bank of solution.
great !
thanks for the quick response. the solution looks good. :)
thnx for the answer. it was perfect. just the way i wanted it.
works fine.