Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Doubly-linkedlist

Doubly-linkedlist

Doubly-linkedlist

Question Description

In this project, you will develop code for a scheduling application. Specifically, you will need to implement two classes, Scheduler and ScheduleNode. Scheduler is the “main” class, and it maintains the schedule as a doubly-linked collection of ScheduleNodes. Each ScheduleNode has a name and duration and represents a single event on the schedule. A header for both classes has been provided, and you are not allowed to modify this file.

The program starts with an empty schedule of length 100, to which the user may add (and later cancel) events. As user adds and removes events to the schedule, there are five main challenges your code should overcome:

  • All valid changes (e.g., scheduling a new event during a free period or cancelling an existing event) should be reflected when the schedule is printed. • Scheduling or cancelling events should not change the total length of the schedule. • The schedule should never show two consecutive events (or free periods) with the same name. Instead, consecutive events with the same name should be merged together into a single event with a duration equal to the sum of the original events. • Every event must have a positive (i.e., non-zero) duration. • All allocated ScheduleNodes must be deallocated.
  • 2 Member function descriptions

    The member functions you will need to implement are as follows:

  • bool Scheduler::isAvailable(unsigned start, unsigned duration) const: returns whether the time period from time start to start + duration is free; times are considered free if they occur during a ScheduleNode with name == “FREE”. Valid times are 0–99; the head SchedulerNode is considered to start at time 0, and the next node starts immediately after the previous node ends. Times beyond the Scheduler’s length are not considered free. • void Scheduler::schedule(const string& name, unsigned start, unsigned duration): schedule a new event with the given name and duration at a given time, making sure not to create an invalid schedule (e.g., length 6= 100, consecutive nodes with same name, or 0length node). You may assume that the user has already called isAvailable on the start and duration.
  • 1

  • void Scheduler::free(unsigned start): frees up the time associated with the event that starts at the given time (i.e., sets that time back to FREE), without creating an invalid schedule. Has no effect if the time is already free or no event starts at that time. • void Scheduler::printSchedule() const: prints information for all of the events in the schedule, in the following format:
  • TIME: NAME (DURATION) where TIME represents the start time of the event, NAME the event’s name, and DURATION the length of the event. Note that there are two spaces after the colon and one before the open parenthesis. • Scheduler::~Scheduler(): destroys the Scheduler, freeing all ScheduleNodes. You are not required to implement a copy constructor or copy assignment operator for the Scheduler. • void ScheduleNode::merge(ScheduleNode* other): (Optional) compares this ScheduleNode to its argument (which should be the next or previous node), and combines the two nodes into one with the same name where the length is the sum of the two original nodes. This function is not called by the driver and is totally optional, but you may find it helpful to implement this so that you can use it in other functions.

    Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

    Order Solution Now

    Our Service Charter


    1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

    2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

    3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

    4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

    5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

    6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

    We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

    Stuck with your Assignment?

    Enjoy 20% OFF Today
    Use code SAVE20