Doesn't tmp point to the same memory location as ptr->next? Why does it matter which we delete?

  • 0

    Thank you for the response--I do have a follow up questions. But in the second scenario, we're setting the temp pointer to the exact same memory location as ptr->next. So why does it matter which one we delete? Aren't we effectively deleting the same node in either case?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.