List Data Structure: Data Structures and Algorithms in Java 1/23
List Data Structure: Data Structures and Algorithms in Java 1/23
List Data Structure: Data Structures and Algorithms in Java 1/23
DataNode DataNode
Employee info; Employee info;
DataNode next; DataNode left;
DataNode right;
Self-Referential Structures
Data Structures and Algorithms in Java 5/23
Linked Lists
6
• A linked structure is a collection of nodes storing data
and links to other nodes
• A linked list is a linear data structure composed of nodes,
each node holding some information and a reference to
another node in the list
• Types of linked lists:
– Singly-Linked List
– Doubly-Linked List
In programming, linear means that they are described by one (single) series of data … ie.
Each data item has at most one predecessor and at most one successor.
And, Non-linear means anything else.
Linear are – Array, Linked List, Stack, Queue. Non Linear are – Tree, Graph
head tail
Inserting nodes at the front of a circular singly linked list (a) and at its end (b)