Stages You Need to Do
In this lab you will write code to add a node to a linked list, and delete the node at the front of the linked list. Here is the solution code: lab12.cpp below
Problem 1 (1 point) :
Manually add 2 nodes to a linked list. Display the list after each time.
Problem 2 (1 point) :
Delete the node at the front of the list. Display the list.
Problem 3 (Extra credit) :
Write code to run the adding and deleting in an infinite loop. Refer to the sample code for more detail.
**Note: If you use lab computers, you can now use Terminal to compile your code, using the command: g++ lab12.cpp
If it's not possible, you need to first connect to the bert server for compiling and running the program, as the lab computers do not have c++ compiler.
Do the following steps:
1. open "terminal", and type: ssh username@bert.cs.uic.edu
2. it will ask for your password: ( the username and password are the same as the cs account username and password you used to log into the lab computers.)
3. find your program file and use g++ to compile. (for example, if your "lab12.cpp" file is saved on Desktop, then you need to do: cd Desktop and then: g++ lab12.cpp
4. run the program: ./a.out