Question
Using C++ or Java, create a doubly linked list data structure . At a minimum, you must have a List class that contains the list
Using C++ or Java, create a doubly linked list data structure. At a minimum, you must have a List class that contains the list functionality (including an insert function) and a linking object ("node") class. Include the data in the node objects. Your list must have functions to both insert and remove (and return) values from both the front and end of the list. You must code the list yourself use of a "standard container" (such as an STL class, Vector, or ArrayList) is not permitted.
Using composition (with the List class,) define a Stack class that has push and pop 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. Push each string into your Stack. After you have read all of the input, pop each string from your Stack, printing it to STDOUT (one per line). Your program should have no other output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started