Khan.randRange(5, 7) Khan.randRange(0, 999) Khan.randRange(1, arr_size-1) LinkedListAddPRO.initJSAV(arr_size, insert_pos,insert_value)

Your task in this exercise is to show the behavior for linked list insertion, by inserting the value insert_value to the given position. In the process, you will need to create a new node and move some pointers.

To move an element value from one node to another, click on it (to highlight it), then click on the element position in the node where you want it to go. You can insert the new value insert_value into a highlighted node by clicking the "Insert Value" button. You can create a new list node by clicking the "New Node" button.

To change a pointer, click on its box (on the right side of the node) to highlight it, then click on the node that you want it to point to. Note that you can you can only assign pointers to nodes that are visible to the algorithm! The visible nodes are new nodes, and the one pointed to by prev, and their successors. To move the prev pointer forward, click the "Move Forward" button.

[LinkedListAddPRO.userInput]
if (!LinkedListAddPRO.checkAnswer() && !guess[0]) { return ""; // User did not click, and correct answer is not // initial array state } else { return LinkedListAddPRO.checkAnswer(arr_size); }

You want to reproduce the behavior of the insertion function. Try starting with a new node.

Point the prev pointer to the node before the node where you want to insert the value.

Now you need to fix up the pointers. Click the new node's pointer box, then click the node that should follow it. Click the preceeding node's pointer box, then click the new node.