Definitions: - Lists and Arrays - Nodes and Pointers - Single Linked Lists - Double Linked Lists - Circular Lists
Definitions: - Lists and Arrays - Nodes and Pointers - Single Linked Lists - Double Linked Lists - Circular Lists
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Introduction
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Index
Value
0
44
1
5
2
96
3
3
Introduction
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Introduction
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Introduction
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Introduction
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Circular Lists
Introduction
Definitions
Lists and arrays
Nodes and pointers
Single Linked Lists
Double Linked Lists
Circular Lists
Advantages
Advantages
The Linked List advantages are collected because of the
array disadvantages, array disadvantages are:
1. Array Size
2. Memory allocation
3. Insertion and Deletion
Outline
Introduction
Insertion Description
Deletion Description
Basic Node Implementation
Conclusion
Insertion Description
Insertion at the top of the list
Insertion at the end of the list
Insertion in the middle of the list
Insertion Description
Insertion at the top of the list
Insertion at the end of the list
Insertion in the middle of the list
Insertion Description
head
48
17
142
//
Step 2
Step 3
head
93
Insertion Description
Insertion at the top of the list
Insertion at the end of the list
Insertion in the middle of the list
Insertion Description
head
48
17
142
//
Step 2
Step 3
Insertion Description
Insertion at the top of the list
Insertion at the end of the list
Insertion in the middle of the list
Insertion Description
Step 1
Step 3
Step 4
Step 2
Outline
Introduction
Insertion Description
Deletion Description
Deletion Description
Deleting from the top of the list
Deleting from the end of the list
Deleting from the middle of the list
Deletion Description
Deleting from the top of the list
Deleting from the end of the list
Deleting from the middle of the list
Deletion Description
head
6
17
42
17
42
17
42
head
head
Deletion Description
Deleting from the top of the list
Deleting from the end of the list
Deleting from the middle of the list
Deletion Description
head
6
head
17
17
17
head
42
42
Deletion Description
Deleting from the top of the list
Deleting from the end of the list
Deleting from the middle of the list
Deletion Description
head
4
17
42
head
4
17
head
4
42
42
More terminology
A nodes successor is the next node in the
sequence
The last node has no successor
Singly-linked lists
Here is a singly-linked list (SLL):
myList
a
Doubly-linked lists
Here is a doubly-linked list (DLL):
myDLL
a
41
Disadvantages:
Requires more space
List manipulations are
slower (because more
links must be changed)
Greater chance of
having bugs (because
more links must be
manipulated)