How to Iterating all the Elements of a Linked List in java

/*
  Print elements of a linked list

  class Node {
     int data;
     Node next;
  }

 */
 
void Print(Node head) {
   while(head != null){
       System.out.println(head.data);
       head = head.next; 
   }
}

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations