The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 6 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
In this lab, you will create a simple double linked structures consisting of Node objects. Each node will have a pointer to the next node and a pointer to the previous node. You will use a head pointer to keep track of the first node in the linked list, and a tail pointer to keep track of the last node in the linked list. Set both head and tail to NULL when the list is empty. You will store an integer in each node. You can assume all the integers are positive numbers. You will create the list dynamically by user input.
Implement following functions in the linked list:
When user tries to add a new node (functions 1&2), your program will prompt the user to enter a number and validate the input, create a new node in the list, store the value properly, change the head/tail pointers and print the current whole list from head to the tail.
When user tries to delete a node (functions 3&4), your program should check whether the list is empty, if so, give a warning message, and if not, delete the node properly and free the memory, then point the head/tail pointers to the new position, and print out the whole list.
When user tries to print the list from tail to the head (functions 5), your program will print the value from the last node to the first node. If the list is empty, print a message to indicate that.
 Next add two more options to print the head or the tail node value.
Lastly create a linked list from reading a text file. You can create your own text file with some numbers in it, and your program should have an option to create the list from the text file at the very beginning. Then users will continue to manipulate on the existing list.
You need to add one more option in your menu to exit the program.
For this lab, you will not implement the linked list operations using functions/methods that from an outside source. That means you need to write all the functions.
All files separated into implementation and header files. Compile and submit with your main function.
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly