This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//main class for the node and linke list classes | |
package ds.linkedlist; | |
public class app { | |
public static void main(String[] args) { | |
SinglyLinkedList mylist = new SinglyLinkedList(); | |
mylist.insertFirst(25); | |
mylist.insertFirst(30); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ds.SinglyLinkedList; | |
public class Node { | |
public int data; | |
public Node next; | |
public displayNode() { | |
System.out.println("{ "+ data + " }"); | |
} |