The document discusses linked lists, including their definition as a dynamic linear data structure composed of connected nodes where each node contains a data element and a pointer, common operations on linked lists such as traversal, insertion, and deletion, and variations like single vs. double linked lists and circular lists. Algorithms for searching, inserting, and deleting nodes from a singly linked list are presented along with advantages of linked lists over arrays for dynamic data structures.
Linked Lists: Introduction Linked lists
Representation of linked list
operations on linked list
Comparison of Linked Lists with Arrays and Dynamic Arrays
Types of Linked Lists and operations-Circular Single Linked List, Double Linked List, Circular Double Linked List
Linked Lists: Introduction Linked lists
Representation of linked list
operations on linked list
Comparison of Linked Lists with Arrays and Dynamic Arrays
Types of Linked Lists and operations-Circular Single Linked List, Double Linked List, Circular Double Linked List
This Presentation will Clear the idea of non linear Data Structure and implementation of Tree by using array and pointer and also Explain the concept of Binary Search Tree (BST) with example
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
This PPT is all about the Tree basic on fundamentals of B and B+ Tree with it's Various (Search,Insert and Delete) Operations performed on it and their Examples...
Linked List if you don't know anything about linked list than you should read this slide.this is very simple knowledge of linked list.
Hope you like
if you like this then pls share
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
This presentations gives an introduction to the data structure linked-lists. I discuss the implementation of header-based linked-lists in C. The presentation runs through the code and provides the visualization of the code w.r.t pointers.
This Presentation will Clear the idea of non linear Data Structure and implementation of Tree by using array and pointer and also Explain the concept of Binary Search Tree (BST) with example
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
This PPT is all about the Tree basic on fundamentals of B and B+ Tree with it's Various (Search,Insert and Delete) Operations performed on it and their Examples...
Linked List if you don't know anything about linked list than you should read this slide.this is very simple knowledge of linked list.
Hope you like
if you like this then pls share
a. Concept and Definition✓
b. Inserting and Deleting nodes ✓
c. Linked implementation of a stack (PUSH/POP) ✓
d. Linked implementation of a queue (Insert/Remove) ✓
e. Circular List
• Stack as a circular list (PUSH/POP) ✓
• Queue as a circular list (Insert/Remove) ✓
f. Doubly Linked List (Insert/Remove) ✓
For more course related material:
https://github.com/ashim888/dataStructureAndAlgorithm/
Personal blog
www.ashimlamichhane.com.np
This presentations gives an introduction to the data structure linked-lists. I discuss the implementation of header-based linked-lists in C. The presentation runs through the code and provides the visualization of the code w.r.t pointers.
It is a presentation on some Searching and Sorting Techniques for Computer Science.
It consists of the following techniques:
Sequential Search
Binary Search
Selection Sort
Bubble Sort
Insertion Sort
In computer science, a linked list is a linear collection of data elements, in which linear order is not given by their physical placement in memory. Instead, each element points to the next
2. LINKED LIST
DEFINITION
ARRAY Vs LINKED LIST
TYPES
OPERATIONS
3. Introduction
Linear data structure
Dynamic data structure
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
NODE : Info link
Data Pointer
item
4. REPRESENTATION OF A LINKED
LIST WITH 3 NODES
Start
Data item Data item Data item X
Head: pointer to the first node
The last node points to NULL
6. VARIATIONS OF LINKED LIST
Header linked list
Circular linked list
Two-way list(doubly linked list)
7. Variations of Linked Lists
header linked lists
◦ A linked list with a special node called header
node in the beginning of the list
A B C X
Head header node
◦ Header node doesn’t contain the actual data.
8. Variations of Linked Lists
Circular linked lists
◦ The last node points to the first node of the list
A B C
Head
◦ How do we know when we have finished
traversing the list? (Tip: check if the pointer of
the current node is equal to the head.)
9. Variations of Linked Lists
Doubly linked lists
◦ Each node points to not only successor but the
predecessor
◦ There are two NULL: at the first and last nodes
in the list
◦ Advantage: given a node, it is easy to visit its
predecessor. Convenient to traverse lists
backwards
A B C
Back info
forw
Head Tail
10. Operations on singly linked
list
Creation
Traversing(visiting)
Counting
Insertion
Deletion
Searching
Merging(concatenating two lists)
Reversing the list
Updating
Copying
11. Algorithm to traverse and count
one-way list
Set PTR=HEAD.
Set count =0.
Repeat step while PTR!=NULL
• Apply process to INFO[PTR].
• Set COUNT=COUNT+1
• Set PTR=LINK[PTR].
Write : COUNT
EXIT
12. Algorithm to search an element
ITEM in an unsorted one-way
list HEAD=NULL, then
Set
• Write: “list is empty”
• Set LOC= NULL
• And exit
Set PTR=HEAD
Repeat while PTR=!NULL
• If ITEM=INFO[PTR]
• Set LOC=PTR
• And exit
• Else
• Set PTR=LINK[PTR]
14. Algorithm to search an element
ITEM in an unsorted one-way list
Set HEAD=NULL, then
• Write: “list is empty”
• Set LOC= NULL
• And exit
Set PTR=HEAD
Repeat while PTR=!NULL
• If ITEM=INFO[PTR]
• Set LOC=PTR
• Write:”search is successful”
• And exit
• Else if ITEM>INFO[PTR]
• Set PTR=LINK[PTR]
• Else[ITEM<INFO[PTR]]
• Set LOC=NULL
• Write:”search is unsuccessful”
• And exit
16. Algorithm to insert an element
ITEM at the begnning one-way
list
If AVAIL=NULL, then
• Write:”overflow”
• And exit
Set NEW=AVAIL
• Set AVAIL=LINK[AVAIL]
Set INFO[NEW]=ITEM
Set LINK[NEW]=HEAD
• Set HEAD= NEW
EXIT
17. Algorithm to insert an node after
a node with location LOC in
one-way list
If AVAIL=NULL, then
• Write:”overflow”
• And exit
Set NEW=AVAIL
• Set AVAIL=LINK[AVAIL]
Set INFO[NEW]=ITEM
If LOC =NULL, then
• Set LINK[NEW]=HEAD
• Set HEAD =NEW
19. Algorithm to delete first node of
one-way list
If HEAD=NULL, then
• Write:”underflow”
• And exit
Set NEW=HEAD
• Set HEAD=LINK[HEAD]
Set LINK[NEW]=AVAIL
• Set AVAIL=NEW
EXIT
20. Algorithm to delete a node with
location LOC from one-way list
If HEAD=NULL, then
• Write:”underflow”
• And exit
If LOC=NULL, THEN
• Write:”node not found in the list
• And exit
If LOCP=NULL, then
• Set HEAD=LINK[HEAD]
Else
• Set LINK[LOCP]=LINK[LOC]
22. ARRAY VERSUS LINKED
LISTS
Linked lists are more complex to code and manage
than arrays, but they have some distinct
advantages.
◦ Dynamic: a linked list can easily grow and shrink in size.
We don’t need to know how many nodes will be in the list. They
are created in memory as needed.
In contrast, the size of a C++ array is fixed at compilation time.
◦ Easy and fast insertions and deletions
In array, Insertion and deleltion are more time consuming as
large no. of elements need to be shifted to make space for
inserting a new element or to cover the space created by
deleting an existing element.
With a linked list, no need to move other nodes. Only need to
reset some pointers.