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 doubly linked list
Reverse a doubly linked list
Sort by
recency
|
692 Discussions
|
Please Login in order to post a comment
this is my solution def reverse(llist): # Write your code here current=llist prev_node=None while current: current.prev,current.next = current.next,current.prev prev_node = current current = current.prev
geeze hackerrankk, fix your C# templates!!!!!!!!!!!!!!!!
remove class result but keep its guts. Change function to not be public.
My code in c++:
}
This is the easiest and most efficient way I've found to reverse a doubly linked list in python 3