We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It is only returning the node not really deleting anything.
Consider this scenario: LinkedList with only one node: Head.
if we call the delete fucntion with position =0, the function will return null, but the head is still there. So if you go back and want to do any operations on the LinkedList, it wont be an empty list. It will have a head node in there.
Delete a Node
You are viewing a single comment's thread. Return to all comments →
It is only returning the node not really deleting anything. Consider this scenario: LinkedList with only one node: Head. if we call the delete fucntion with position =0, the function will return null, but the head is still there. So if you go back and want to do any operations on the LinkedList, it wont be an empty list. It will have a head node in there.