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.
Reverse a linked list
Reverse a linked list
Sort by
recency
|
905 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch video explanation here : https://youtu.be/F4nGusqPIu0
reverse, stack, current = SinglyLinkedList(), [], llist while current: stack.append(current.data) current = current.next while stack: reverse.insert_node(stack.pop()) return reverse.head
JAVA syntex is wrong in starting code.
comment out line 55 : class Result { and one closing parenthesis before writing code
Fourth broken C# template.
Remove class result but keep its guts. make reverse function non-public (remove public keyword).
Geeze hackerrank -- didn't expect it that bad. And you guys test for our ability to program?
Cannot be solved via c#, its broken. Fields for the node needs to be changed to nullable.