Lecture 1 - Linked Lists
Lecture 1 - Linked Lists
Advanced
Data
Structures
Instructor:
Anthony Nwohiri
Department of Computer Sciences
University of Lagos
Who uses data structures?
Software Software
engineers developers
Recommended Texts
2. Array
3. Linked lists
4. Trees
Binary tree
Course Binary search tree
Outline
Threaded binary trees
Balanced tree
Height balanced binary search tree – AVL trees
M-way
B-trees
B+ trees
Red-black trees
Applications, advantages and disadvantages
5. Heap
Course Outline (Dr. Sennaike)
12. Spatial
10. Skip Lists 11. Tries Data
Structures
What is a linked data structure?
At the end
of today’s What is a Linked List?
lecture,
What are the types of linked lists?
the
student is Operations carried out on linked
expected lists
to know Application in real world
the
following Advantages and disadvantages
Data structures
The idea is to reduce the space and time complexities of different tasks.
Choosing the right data structure
for your algorithm
Consider the problem requirements
Keep it simple
Primitive data types
Operation
on Linked
Lists
Deletion: To delete nodes Searching: To search for an
from specific positions. element from the linked list.
Singly Linked
List
Doubly Linked
Linked list List
Circular Singly
Linked List
Circular Linked
List
Circular Doubly
Linked List
Disadvantages
§ Uses more memory than arrays.
§ Could end up in an infinite loop.
§ Not easy to reverse.
The pointer last points to node Z and last -> next points to node P.
Monday, November 11, 2024 47
Circular Singly Linked List - Insertion
Why have we taken a pointer that points to the last node instead
of first node ?
After insertion,