A-Linear Data Structures
A-Linear Data Structures
Structures
List ADTs
List ADT
Purpose: To overcome the demerits of Arrays
Definition:
An ADT with two properties:
Any number of objects/nodes
Insertion or deletion at any place in the list
Types:
Linear Linked lists
Using 2D-arrays
Using self-referential records
Stack ADT
Queue ADT
Operations
Creation
Insertion
Deletion
Traversal
Linear Linked Lists
Using self-referential structures/records
Draw a block diagram
Types
Singly linked lists
Doubly linked lists
Circular linked lists
Singly
Doubly
Draw and show block diagrams for each type
Operations
Creation
(achieved thru’ repeated insertion)
Need for maintaining in sorted order
Insertion
Deletion
Traversal
Singly Linked List
Insert operation contd…
Delete Operation
Practice questions
Write an algorithm for inserting a node into a singly linked list without
“PREV” variable.
Write an algorithm for deleting a node from a singly linked list without
“PREV” variable.
Write an algorithm for creating a singly linked list with a bunch of
data at a time thru’ repeated insertion operations.
Write an algorithm for traversing a singly linked list completely with
a purpose of printing the contents of each node.