Question: 2 Linked Lists such that: One linked list is TODAY'S appointments One linked list is FUTURE appointments TODAY's list can only have 24 appointment When

  • 2 Linked Lists such that:
  1. One linked list is TODAY'S appointments
  2. One linked list is FUTURE appointments
  3. TODAY's list can only have 24 appointment When a new appointment is scheduled it will be added to either the back of TODAY's list (if TODAY's list has less than 24 appointments) or to the back of the FUTURE list (if TODAY's list is full)
  • When an emergency appointment is scheduled, it will be added to the frontof TODAY's list (if TODAY's list is already full, the appointment at the back of TODAY's list must be added to the front of the FUTURE list
  • Your program requirements:

    A stucture for appointments nodes which need at MINIMUM (you may add more fields if you desire):

      • An unique appointment number (may want a counter in main() to set this value)
      • A next pointer to point to the next node in the list
      • schedule() function:
      • Should allow you to add a new appointment to your linked list following the rules of the scheduling algorithm.
      • You may want to take in a parameter to indicate if the new appointment is an emergency or not

    OR

      • You could have two different scheduling functions...One for scheduling regular appointments and one for scheduling emergency appointments.
    • print() function:
      • Should print out the appointment schedule so that it is easy to see which appointments are for TODAY and which are for the FUTURE and that all appointments are printed in the order they would be processed (first appointment of the day should be the one at the front of TODAY's list)
    • main() :
      • Should create and manage pointers to the two required linked lists
      • Should schedule 2 emergency appointments using your scheduling function
      • Use your printing function to demonstrate that all appointments were added correctly
      • Should schedule 30 regular appointments using your scheduling function
      • Use your printing function to demonstrate that all appointments were added correctly
      • Should schedule 2 emergency appointments using your scheduling function
      • Use your printing function to demonstrate that all appointments were added correctly
    This is going to be a c program, thank you

    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!