Your instructions for today's lab:
Write code to traverse through a linked list and print out the contents. (1 pt)
Print out the size of the contents (1 pt)
Enter a position number that is 0 <= x <= size - 1 (an index value), then insert a value after the index specified. (1 pt).
Assume it is indexed at 0 and the Linked List must be greater than or equal to 1.
Example:
Since we are doing this in ZyBooks, we will need to be meticulous in how we write to standard input.
If I enter, 5 2 9 10 50 -1 3 200 in the input box, it should print the following:
The Linked List: 50 10 9 2 5
The Size: 5
Your entered index value that that is less than the size is: 3.
You want to insert the following number AFTER the index specified above: 200
The New Linked List: 50 10 9 2 200 5
The New Size: 6
Important:
Make note that in the example above, the -1 is our flag to let the program know we are finished creating our initial Linked List.
The 3 is the index value specified.
The 200 is the data element we insert AFTER (so at index 4) the index specified.
You do not need to touch main. All the print statements and function calls are done for you. You need to fill in the blanks in the TODO sections.
There are 3 test cases. Each test case is 1 point.
All of the test cases are hidden. You will not be able to see them as it can easily be hard-coded.
Always draw out the behavior in which your code is acting and work according to fix any bugs.
Grading Rubric is specified above in the problem. You will have 45 minutes to submit.
You must also show one of the TAs in the room that you have completed your Lab before leaving.