Khan.randRange(1, 6) Khan.randRange(0, 999) lqueueEnqueuePRO.initJSAV(arr_size,insert_value)

Enqueue a new value by creating a new node, placing the value, and adjusting "front" and "rear" if appropriate.

Click "NewNode" to create a new node. Click "Insert" to put the new value into the new node. To change a pointer's destination, first click the pointer then click the new destination.

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

We need something to insert into, so click "NewNode".

Then, the only place the new value can go is into the new node. So click "Insert".

The new node must go at the end of the queue. So set the (null) pointer of the last node in the list to point to the new node.

Finally, update "rear" to point to the new node.