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.
Not sure if you're still active after 2 years, but I've a question:
If the list is long enough that the stack size could be a problem, wouldn't a singly linked list be inefficient by nature? If that's the case, it would be safe to assume the list is indeed short enough for a recursive solution.
Or are its benefits (simplicity, speed of adding a node at either end) enough to still make it a desirable option?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Delete a Node
You are viewing a single comment's thread. Return to all comments →
Not sure if you're still active after 2 years, but I've a question:
If the list is long enough that the stack size could be a problem, wouldn't a singly linked list be inefficient by nature? If that's the case, it would be safe to assume the list is indeed short enough for a recursive solution.
Or are its benefits (simplicity, speed of adding a node at either end) enough to still make it a desirable option?