Theprogrammersfirst
A technical portal. It contains well explained topics and articles.
Home
Tutorials
Java
Data Structure
Algorithm
Interview Questions
Ask Question
Discussion
About Us
2016-06-08
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;
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment