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.
Print in Reverse
Print in Reverse
Sort by
recency
|
998 Discussions
|
Please Login in order to post a comment
def reversePrint(llist): # Write your code here curr = llist if curr is None: return reversePrint(curr.next) print(curr.data)
I was working on this reverse-print linked list problem, and the way I understood it was by comparing it to the Denny’s breakfast menu. You don’t change anything on the menu, you just read it from the bottom instead of the top. Same with the list: go to the end first, then print everything backward.Select 44 more words to run Humanizer.
implementation in TypeScript
def reversePrint(llist): # Write your code here
Golang Solution with recursive: