Linked List
Linked List
List Overview
Linked lists
What is a Linked List
Basic operations of linked lists
Insert, search, delete.
Variations of linked lists
Circular linked lists
Doubly linked lists
Linked Lists / Slide 3
Linked Lists
A B C
Head
A linked list is a series of connected nodes
Each node contains at least
A piece of data (any type)
Pointer to the next node in the list
Head: pointer to the first node node
The last node points to NULL A
data pointer
Linked Lists / Slide 5
Create a LinkedList
A B C
Head
A B C
Head
Linked Lists / Slide 12
Exercise
You are given the task of implementing a singly linked list in
Java. In your main method, create an instance of the Linked List
class, insert the elements "A," "B," "C," "D," and "E" into the list,
and then perform the following operations:
Print the list.
Check if the list contains "B" and print the result.
Remove "C" from the list.
Print the modified list.