Reinforcing manipulation of linked lists
During this lab, you will need to draw diagrams on paper to show the steps of some manipulation on linked list. Then you need to write the code (also on paper) to implement each step labelled in your diagram. You should be prepared to explain your answers/code to the TA or another student group.
You are given the code which implements adding multiple nodes to a linked list and finding the node at a given location in the list, then you will need to implement the delete function in the following stages:
(1 point) Stage 1. You will get a sheet of paper with a diagram of the current list of letters on it. Draw a picture of the linked list after the call to delete( 3) where 3 is the index of the node to be deleted. Hint: remember that for some value n you can also call delete( n-1). You will need 3 or 4 steps. Number each step.
(1 point) Stage 2. On paper implement the delete(n) function : write the corresponding code for each step labelled in your diagram from Stage 1.
(Extra point) Stage 3. How many other cases are there to consider? Demonstrate your answer in writing using diagrams and/or code. You must be prepared to thoroughly explain your answer to the TA or to another student group.
The pdf version of the handout is also attached below.