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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started