I need help with this in Java. Thanks. 1. Given a linked list and 2 reference va
ID: 3753711 • Letter: I
Question
I need help with this in Java. Thanks.
1. Given a linked list and 2 reference variables: "start" points to the first node inthe list, "aurrent" points to some node in the list, how would you refer to the element after "current"? A. current.next B. start.next C. list.next D. next 2. Given a linked list with enough elements and a reference variable startthat points to the first node inthe list, which of the following lines reads the data of the 3rd node (if you prefer index-counting: that would be Node at index 2)? A. start.next.next.next. data B. start.next.next.data C. start.next.data D. start. dataExplanation / Answer
1) current.next Explanation: ------------- to refer element after current, you just do next on current. 2) start.next.next.data Explanation: ------------- start points to 0th index start.next points to 1st index start.next.next points to 2nd index to get the data of 2nd node, we do start.next.next.data
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.