Question: Java public void () figure { Node current = head; while (current != null) { current.next = current.next.next; current = current.next } If we make
Java
public void () figure {
Node current = head;
while (current != null) {
current.next = current.next.next;
current = current.next }
If we make an singly linked list (firstlist) and add the numbers 1, 2, 3, 4, 5, 6 and 7 to firstlist so that list consists of those seven numbers in order, then what does firstlist look like after calling firstlist.figure()?
Now pretend we make an singly liked list (seclist) and put the numbers 1, 2, 3, 4, 5 and 6 to seclist so seclist has those six numbers in order). What happens when calling seclist.figure()?
Explain the differences.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
