Question
Complete the C++ program below, by adding necessary member functions to the class List. When a main program such as if it runs, the output
Complete the C++ program below, by adding necessary member functions to the class List. When a main program such as if it runs, the output has to be similar to the sample output. In the main program you will work with a list of integers. The whole program should be written in one file ?StudentFullName.cpp? #include
Sample output: Operations on Linked lists... 1- Insert an element in the front of the list.... 2- delete an element from the front of the list.. element at the end of the list. 3- Insert an 4- Search an element in the list... 5- delete an element from the list..... 6- display all elements in the list... 7- display all elements in the list in reverse order. 8- display the length of the list.. 9- Exit the program... Choose an option from the menu: 1 Enter the integer to insert:1 Choose an option from the menu: 1 Enter the integer to insert:2 Choose an option from the menu:1 Enter the integer to insert:3 Choose an option from the menu: 6 List content: [3]--> [2]--> [1] --> Choose an option from the menu:3 Enter an integer to insert at the end:0 Choose an option from the menu: 6 List content: [3]--> [2] --> [1] --> [0] --> Choose an option from the menu: 7 List content backwards: [0]--> [1]--> [2]--> [3]--> Choose an option from the menu:8 length of list = 4 Choose an option from the menu:2 Choose an option from the menu: 6 List content: [2]--> [1]--> [0] --> Choose an option from the menu:5 Enter an integer to remove from the list:2 2 removed from list Choose an option from the menu:6 List content: [1]--> [0]--> Choose an option from the menu:1 Enter the integer to insert: 2 Choose an option from the menu:6 List content: [2] --> [1] --> [0] --> Choose an option from the menu:4 Enter an integer to search in the list:1 We found 1 Choose an option from the menu: 4 Enter an integer to search in the list:8 We did not find 8 Choose an option from the menu:9 End of the program
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
Step: 1
include include using namespace std Header template class Node private T data Node next public NodeT ...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