You are viewing a single comment's thread. Return to all comments →
In your code:
if(head == null) { head = tmp; return head; }
Why not simply return tmp instead of re-assigning head to tmp and then returning head?
tmp
head
Just curious. Thanks!
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a Node at the Tail of a Linked List
You are viewing a single comment's thread. Return to all comments →
In your code:
Why not simply return
tmp
instead of re-assigninghead
totmp
and then returninghead
?Just curious. Thanks!