Question: Using C++ Suppose a program has to maintain a list of flights departing in the next few hours, and we have decided to implement it

Using C++

Suppose a program has to maintain a list of flights departing in the next few hours, and we have decided to implement it as a doubly linked list. A node of the list can be represented as:

struct NODE { FLIGHT flight; NODE *next; NODE *previous; }; struct FLIGHT { int flightNum; string destination; }; 

Create a doubly linked list to hold the initial flight information:

Houston, Chicago, Arizona, Baltimore, Detroit, Denver, Houston

Your program must implement the following methods: Append, Prepend, Remove, InsertAfter, and Print

The Append function, appends data to the end of the list

The Prepend function, prepends data to the beginning of the list

The Remove function, removes a node from the list and adjusts the length of the list

The Print function must print the entire list

Prepend Dallas to the list

Remove Arizona from the list

Append Kansas City to the list

Insert Minneapolis after Kansas City in the list

Remove Houston from the list

Print the flight record using the Example of how your output is supposed to look:

Example:

Flight Records for HowardAir Flight CSCI0136:

Dallas to Houston

Houston to Chicago

Chicago to Baltimore

Baltimore to Detroit

Detroit to Denver

Denver to Kansas City

Kansas City to Minneapolis

Minneapolis to Dallas

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!