Print the Elements of a Linked List

  • + 0 comments

    Python

    def printLinkedList(head):
        while head:
            print(head.data)
            head=head.next