linked_list
Dummy node trick
LinkedListNode dummy = new LinkedListNode( 0 );
LinkedListNode tail = dummy;
// append one more element to the tail
tail.next = appendedNode;
// move tail pointer forward
tail = appendedNode;
return dummy.next; // pointing to the actual list headCommon tasks
Last updated