Skip to main content

Posts

Showing posts with the label Algorithm & Data Structure

LinkedList in Java

This tutorial will show you a Linked List implementation in Java. It will have following features- - Add nodes from both ends (Beginning and End) - Delete nodes from Beginning - Get count of nodes - Get First & Last node - Get Node at a specific position Please let me know if you find some incorrect scenarios. Node structure- /**   * LinkedList Node   */ public class Node {       /**         * Holds any type of Object Data         */       public Object data ;       /**         * Pointer to a Node         */       public Node pointer ; } Linked List /**   * LinkedList Implem...