//It's 2:49 AM on 2/22/2008. I felt like coding something in Java, to refresh my knowledge of Java //And what i wrote was this - Linked list //This code just inserts some number of nodes, prints them //And, before proceeding to do something more, i lost interest and switched over to some web designing! class Node { int data; Node link; Node() { this.data=0; } Node(int n) { this.data=n; } } class LinkedList { public static void main(String[] args) { new LinkedList().run(); } public void run() { Node root=new Node(1); //System.out.println(root); for (int i=1; i<10; i++) { push(root,(i*i)); } display(root); } public void push(Node node, int num) { while (node.link!=null) { node=node.link; } node.link=new Node(num); //System.out.println(node.link); } public void display(Node node) { while(node!=null) { System.out.println("Got " + node.data); node=node.link; } } }