head.setNext(head);
(7, Ajay, NFL)à(3, Sarah, Mario)à(9, Jim, Golf)àhead
(5, Joe, Sonic)ànull
tail
(7, Ajay, NFL)à(3, Sarah, Mario)à(9, Jim, Golf)ànull
head
JAVA
1. The answer is: It becomes a never ending loop and the other nodes in the list cannot be reached.
2. The dequeued item is: (9, Jim, Golf)
3. The first item is: (7, Ajay, NFL)
The last item is: (5, Joe, Sonic)
4. The advantage of linked lists over arrays is: Nodes of linked list are stored in different parts of memory.
(20 pts) What would happen if you execute the following code just before traversing a linked...
1. What would happen if you execute the following code just before traversing a linked list? head.setNext(head); 2. The linked list that follows represents a queue. If we dequeue once, what item is dequeued? (7, Ajay, NFL)à(3, Sarah, Mario)à(9, Jim, Golf)àhead (5, Joe, Sonic)ànull tail 3. The linked list that follows represents a stack. After we push the player (5,Joe,Sonic) onto the stack, what are the first and last items on the stack? (7, Ajay, NFL)à(3, Sarah, Mario)à(9, Jim, Golf)ànull...