You are viewing a single comment's thread. Return to all comments →
This happens due to the "build rest of list" part where we do Node n = head; and proceed to set the next nodes with n.next = ...
Node n = head;
n.next = ...
n builds out the rest of the list for us, and it initially pointed to head
n
head
HackerRank solutions.
Seems like cookies are disabled on this browser, please enable them to open this website
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
This happens due to the "build rest of list" part where we do
Node n = head;
and proceed to set the next nodes withn.next = ...
n
builds out the rest of the list for us, and it initially pointed tohead
HackerRank solutions.