0% found this document useful (0 votes)
34 views14 pages

DS Presentation

The presentation discusses linked lists, a linear data structure consisting of nodes connected by links. It covers the basics, types (singly, doubly, and circular linked lists), operations (insertion, deletion, traversal, searching, and reversing), and the advantages and disadvantages of using linked lists. The conclusion emphasizes their importance in computer science and software development.

Uploaded by

S. Kabir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views14 pages

DS Presentation

The presentation discusses linked lists, a linear data structure consisting of nodes connected by links. It covers the basics, types (singly, doubly, and circular linked lists), operations (insertion, deletion, traversal, searching, and reversing), and the advantages and disadvantages of using linked lists. The conclusion emphasizes their importance in computer science and software development.

Uploaded by

S. Kabir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

WELCOME

T O O U R P R E S E N TAT I O N
PRESENTATION TOPIC: LINKED
LIST

PRESENTED BY:

1. MD SHAHRIAR KABIR (232-15-289)


2. MD SHAHRIAR HOSSAIN NIBIR(232-15-706)
3. MAHFUZ HASAN MON(232-15-796)
BASICS OF LINKED LIST
Linked List is a linear data structure which is a sequence of data
structures, that are connected together via links and it is very
common data structure which consists of group of nodes in a
sequence that is divided in two or more parts.

Fig: Linked List


Basic Operation Supported By a List

Insertion − Adds an element at the beginning of the list.

Deletion − Deletes an element at the beginning of the list.

Display − Displays the complete list.

Search − Searches an element using the given key.

Delete − Deletes an element using the given key.


Linked list node creation

struct Node
{ int data ;
struct Node *next ; } ;

Explanation : Declared structure of type “ Node “ ,


First field stores actual data and another field
stores address
A simple C program to introduce a linked list
#include<stdio.h>
#include<stdlib.h>
struct node {
int data;
struct node *next;
};
int main() {
struct node *head = NULL;
struct node *second = NULL;
struct node *third = NULL;
head = (struct
node*)malloc(sizeof(struct node));
second=(structnode*)malloc(sizeof(str
uct node));
third = (struct
node*)malloc(sizeof(struct
node));
head -> data = 1;
head -> next = second;
second -> data = 2;
second -> next = third;
third -> data = 3;
third -> next = NULL;
struct node *ptr;
ptr = head;
while( ptr!=NULL) {
printf("%d\n",ptr -> data);
ptr = ptr->next;
}
return 0;
}
Types of linked list

Singly linked list


Doubly linked list
Circular linked list
Singly Linked List
•In a singly linked list, each node contains
data and a single link to the
next node.
•It starts with a head pointer, which points
to the first node.
•The last node's link points to NULL,
indicating the end of the list.
Fig: Singly Linked List
Operations on Singly Linked List:
1.Insertion
2.Deletion
3.Traversal (Only Forward)
4.Searching
5.Reversing
Doubly Linked List
•In a doubly linked list, each node
contains data and two links: one to the

next node and one to the previous


node.
•It provides more flexibility compared
to a singly linked list but requires extra
memory for the previous pointers. Fig: Doubly Linked List

Operations on Doubly Linked List:

1.Insertion
2.Deletion
3.Traversal (Forward and Backward)
4.Searching
5.Reversing
Circular Linked List
•In a circular linked list, the last
node's link points back to the
first node, forming a circle.
•It can be singly or doubly linked.
•Useful in applications where
elements need to be accessed in
a continuous loop. Fig: Circular Linked
List

Operations on Circular Linked List:


1.Insertion
2.Deletion
3.Traversal
4.Searching
5.Reversing
Advantages and Disadvantages of Linked List

Advantages:

•Dynamic size
•Efficient insertion and deletion
•Memory utilization

Disadvantages:

•Extra memory for pointers


•Not cache-friendly
Conclusion

•Linked lists are fundamental data structures used in


various applications.

•Understanding their types, operations, and applications is


crucial for efficient problem-solving.

•Despite their limitations, linked lists play a vital role in


computer science and software development.
THANK
YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy