Concept Flow - Pop Using Linked List Node
Start at head
Is head null?
Yes→List empty, nothing to pop
No
Is head.next null?
Yes→List has one node, pop that node
No
Traverse to second last node
Set second last node.next = null
Return popped node
Done
Start from the head node, check if list is empty or has one node, otherwise traverse to second last node, remove last node by setting next to null, and return popped node.
