Question: Create a code programm in c language using a linear data structure to simulate a hot potato game with use 6 player to start the

Create a code programm in c language using a linear data structure to simulate a hot potato game with use 6 player to start the game

To simulate the circle, we will use a queue .Assume that the child holding the potato will be at the front of the queue. Upon passing the potato, the simulation will simply dequeue and then immediately enqueue that child, putting her at the end of the line. She will then wait until all the others have been at the front before it will be her turn again. After num dequeue/enqueue operations, the child at the front will be removed permanently and another cycle will begin. This process will continue until only one name remains (the size of the queue is 1).You can have a srand of time, which determines the change for the next person.

You can have as example the next figure>

Create a code programm in c language using a linear data structure

rearBrad KenJane S Dvid Billfront dequeue enqueue Go to the rear (Pass the potato) rearBillraKentae Susan Davidfront

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!