Question: For this assignment you have to write a c program that will use the circular singly linked list and queue data structure Problem: Who will

For this assignment you have to write a c program that will use the circular singly
linked list and queue data structure Problem: Who will get one year of free dedicated parking spot!
Monster campus decided to award a dedicated parking spot to a student for free for the whole
year to their choice of garage. To determine the winner, the campus is hosting a quirky game.
Since parking spots on campus are scarce and expensive, students are eager to compete for the
chance to win.
There are exactly 10 garages on campus, numbered from 1 to 10. Participating students must
choose one garage, and they receive a sequence number based on the order in which they register
for their preferred garage. However, some garages may be less desirable due to their locations, so not all of them may be selected by the students. Ultimately, the students are grouped into G groups (where G =10), based on their unique garage choices, and these groups are assembled on a large campus field. Each group is identified by the garage number they selected, though some
garages may be left unchosen.Game Day! Each group gi consists of ni (ni >=2) students. Every student in the group is assigned asequence number from 1 to ni. These students form a circular line, waiting to be eliminated according to the games rules. However, due to a distraction, it was discovered that the students
in each group were standing in reverse order instead of the correct sequence. In Phase1, eliminations occur within each group. For a given group gi, the elimination phase
continuous until the number of students in the group is reduced to a threshold thi(thi 0) are skipped and the next student is eliminated. This process continues, with the circle shrinking as students are progressively removed. As mentioned, the elimination process for the group gi will stop when
the group has thi number of soldiers.In summary, for a group gi, you have the total number of students ni (ni >=2), and a number ki (ki >0), which indicates that ki-1 students are skipped and kith student is eliminated in circle. There is
a threshold thi (thi ki >0) and then the next integer indicates the value of thi (ni>thi >0) integer.a)You must use linked list and queue in your implementation.b) You must use circular singly linked list for your solution to get full credit. You need to declare appropriate linked list node structure to store a student with sequence number as the data value. c) You must use linked list implementation of queue when applicable. d) Create a node structure for Student that has a sequenceNumber and next pointer e) Create a node structure for a queue that has front and back pointers to point studnets.Also, a good idea would be storing nodeCount, k, and th within the queue structure.f) You must implement and use enqueue, dequeue, peek, isEmpty function for this givenscenario, when possible. For example, you can easily use enqueue function while adding
the students to the queue. However, the phase 1 elimination process is not a queue
operation. Phase 2 can heavily use the peek and dequeue functions.g) You should never access queue front and back properties outside of the queue related
functions.h) In addition to the other functions of a queue like enqueue, dequeue, peek, isEmpty, etcyour code must implement the following functions and use them as part of the solution:i) Student* createStudent(int sequence): It takes an integer, dynamically alloc
For this assignment you have to write a c program

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 Programming Questions!