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 will be overwritten at the next level up, so you set it to null then you go up and set it to the previous node...which is why I think recursion for this problem is not really efficient since you only need to set the next pointer of the original head node to null.
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
it will be overwritten at the next level up, so you set it to null then you go up and set it to the previous node...which is why I think recursion for this problem is not really efficient since you only need to set the next pointer of the original head node to null.