"""
 Print elements of a linked list in reverse order as standard output
 head could be None as well for empty list
 Node is defined as

 class Node(object):

   def __init__(self, data=None, next_node=None):
       self.data = data
       self.next = next_node


"""

def ReversePrint(head):
    l=[]
    node = head
    while node:
        l.append(node.data)
        node = node.next
    for value in reversed(l):
        print value

results matching ""

    No results matching ""