subject

In an ancient land, the beautiful princess Eve (or handsome prince Val) had many suitors. Being royalty, it was decided that a special process must be used to determine which suitor would win the hand of the prince/princess. First, all of the suitors would be lined up one after the other and assigned numbers. The first suitor would be number 1, the second number 2, and so on up to the last suitor, number n. Starting at 4 the suitor in the first position, she/he would then count three suitors down the line (because of the three letters in his/her name) and that suitor would be eliminated and removed from the line. The prince/princess would then continue, counting three more suitors, and eliminate every third suitor. When the end of the line is reached, counting would continue from the beginning. For example, if there were 6 suitors, the elimination process would proceed as follows:. 12456 Suitor 3 eliminated; continue counting from 4.
1245 Suitor 6 eliminated; continue counting from 1.
125 Suitor 4 eliminated; continue counting from 5.
15 Suitor 2 eliminated; continue counting from 5.
1 Suitor 5 eliminated; 1 is the lucky winner.
Write a program that creates a circular linked list of nodes to determine which position you should stand in to marry the princess if there are n suitors. Your program should simulate the elimination process by deleting the node that corresponds to the suitor that is eliminated for each step in the process.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Need getting google account back, big issue
Answers: 2
question
Computers and Technology, 25.06.2019 06:50
Write a program that will askthe user to enter the amount of a purchase. the program should thencompute the state and county sales tax. assume the state sales tax is4 percent and the county sales tax is 2 percent. the program should displaythe amount of the purchase, the state tax, the county sales tax, the total salestax, and the total of the sale. (which is the sum of theamount of purchase plus the total sales tax). hint: use the value 0.02 torepresent 2 percent, and 0.04 to represent 4 percent.
Answers: 2
question
Computers and Technology, 25.06.2019 13:00
Self -concept is influenced by the values instilled in a person by his or her self-concept. self-fulfilling prophecy. self-evaluation. culture.
Answers: 1
You know the right answer?
In an ancient land, the beautiful princess Eve (or handsome prince Val) had many suitors. Being roya...
Questions
question
English, 15.01.2022 20:30
question
Mathematics, 15.01.2022 20:30
question
Mathematics, 15.01.2022 20:30
Questions on the website: 13722363