Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions

Question

What general conclusions can be drawn from research on experience?

Answered: 1 week ago