Khan.randRange(4, 6) Khan.randRange(0, 999) Khan.randRange(0, arr_size-1 - 2) llistInsertPRO.initJSAV(arr_size, insert_pos,insert_value)

Your task in this exercise is to show the behavior for linked list insertion. You must insert the value insert_value to the current position. In the process, you will need to create a new node and move some node values and 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" button. You can create a new link node by clicking the "NewNode" 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.

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

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

Remember that the new node has to come after the current node in the list, but we want the new value to appear before the the current node's value.

So move the current node's value to the new node's value, then use "insert" to put the new value into the current node.

Now you need to fix up the pointers. Click the new node's pointer box, then click the node after current. Click the current node's pointer box, then click the new node.