Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++, create a doubly linked list data structure that stores strings. At a minimum, you must have a List class that contains the list

Using C++, create a doubly linked list data structure that stores strings. At a minimum, you must have a List class that contains the list functionality (including an insert function) and a linkable object ("link node") class. For convenience, you may include the data directly or the data may be external to the link node, connected with a reference. You may use an inner class for the LinkNode and/or include the LinkNode class with the List class file if you wish. Your list must have functions to both insert and remove (and return) values from both the front and end of the list. Use of a "standard container" (such as an STL class, Vector, or ArrayList) is not permitted.

Using composition (with the List class,) define a Queue class that has enque and deque functions, as well as an isEmpty function. (Each of your classes may have any additional functionality that you deem necessary)

Write a main function that will read an unspecified number (until EOF) of input strings (each string may include whitespace and is terminated with a newline) from STDIN. Enque each string into your Queue. After you have read all of the input, deque each string from your Queue, printing it to STDOUT (one per line) until the Queue us empty. Your program should have no other output.

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

Multidimensional Array Data Management In Databases

Authors: Florin Rusu

1st Edition

1638281483, 978-1638281481

More Books

Students also viewed these Databases questions

Question

What is productivity measurement?

Answered: 1 week ago