You are viewing a single comment's thread. Return to all comments →
Python3 solution. There is no reason for these silly reverse for loops.
def ReversePrint(head): if head is None: return None else: stack = [] while head: stack.append(head.data) head = head.next while stack: print(stack.pop())
Seems like cookies are disabled on this browser, please enable them to open this website
Print in Reverse
You are viewing a single comment's thread. Return to all comments →
Python3 solution. There is no reason for these silly reverse for loops.