Print the Elements of a Linked List

  • + 6 comments

    Java:

    void Print(Node head) {

         while ( head != null) {
            System.out.println(head.data);
            head = head.next;
    
    } 
    

    }