SlideShare a Scribd company logo
1 of 17
Data Structures
Agenda
 Introduction
 Arrays
 Linked list
 Single linked list
 Double linked list
 Stack
 Queue
Introduction
Data Structure:
a way to store and organize data in the structured
manner.
Computer's memory is divided into small parts, we
use different data structures to store data in those
small blocks.
Example: Arrays, Linked list, Trees ..........
Arrays
 Array is basic data structure in which we store data
in continues memory locations.
 Array is variable which holds mulitiple elements of
same type.
 Arrays reduce the redendency
 Generic form of arrays:
data type array_name[size];
 Data type: what type of data(int, float, char...)
 Size: number elements you want to store
Arrays
 Every element will have index value
 If you want to access any element we must use index
value of the element.
 Disadavantages:
 Capable of holding only one type of elements.
 Insertion and deletion is very difficult
 Waste of memory is very high
Linked list
 Linked list: collection of nodes which or connected
together
 Node: is just like variable but it holds data and
address of the next node or null.
 Adavantages:
 Memory efficincy is very high
 Insertion and deletion is very easy and fast.
Linked list
 When linked list is useful:
 Do not know the number of data elements
 Your list need to be sorted quickly
 Disadvantages:
 Traversal is very slow
 If you want to access 10th element in the list you
need to cross 9 elements (arrays are very fast
because of index)
 You can move only in one direction in single
linked list
 If one link is corrupted remain data will be lost.
Example program on linked list
Double Linked list
 In single linked we can move only in one direction
 Double linked list allow us to move in direction.
 Double linked is also collection of nodes, but here
node is contains more than 2 fields.
 Node: one field holds data, second field holds
address of next node or null and third field holds
address of previous node or null.
Double linked list
 Disadvantages:
 Need extra space for holding references.
 Still it is very slow to travel across the list.
 Circular linked list:
 If the head of linked list is connected to tail that list
is called circular linked list.
 Application of linked list:
 Stacks and Queues.
Example program
Stack
 Stack
 New nodes can be added and removed only at the
top
 Similar to a pile of dishes
 Last-in, first-out (LIFO)
 Bottom of stack indicated by
a link member to NULL
 Constrained version
of a linked list
Operations on Stack
 push
 Adds a new node to the top of the stack
 pop
 Removes a node from the top
 Stores the popped value
 Returns true if pop was successful
Queue
 Queue
 Similar to a supermarket checkout line
 First-in, first-out (FIFO)
 Nodes are removed only from the head
 Nodes are inserted only at the tail
Operations on Queue
 Insert and remove operations
 Enqueue (insert) and dequeue (remove)
 Disadvantages:
What happens if you're 10th in line at the supermarket and it takes 5 minutes to
process each person ahead of you?
You wait 45 minutes.
References
 http://ccodings.blogspot.com
 http://afizafiz.blogspot.com/2010/10/linked-list-in-c-
programming.html
46267037-Data-Structures-PPT.ppt

More Related Content

Similar to 46267037-Data-Structures-PPT.ppt

Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9dplunkett
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Tutort Academy
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.pptSeethaDinesh
 
Data Structure using c language for beginners
Data Structure using c language for beginners Data Structure using c language for beginners
Data Structure using c language for beginners Vinayak SofTech
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked listsAbdullah Al-hazmy
 
Data Structures(Part 1)
Data Structures(Part 1)Data Structures(Part 1)
Data Structures(Part 1)SURBHI SAROHA
 
Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testspriyanshukumar97908
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptyarotos643
 
Data Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptxData Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptxRameshaFernando2
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdfSulabhPawaia
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using pythonLavanyaJ28
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data StructureJazz Jinia Bhowmik
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.JAYANTAOJHA
 
Data Structure
Data Structure Data Structure
Data Structure Ibrahim MH
 

Similar to 46267037-Data-Structures-PPT.ppt (20)

Ap Power Point Chpt9
Ap Power Point Chpt9Ap Power Point Chpt9
Ap Power Point Chpt9
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
Data Structure using c language for beginners
Data Structure using c language for beginners Data Structure using c language for beginners
Data Structure using c language for beginners
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
 
Data Structures- Part7 linked lists
Data Structures- Part7 linked listsData Structures- Part7 linked lists
Data Structures- Part7 linked lists
 
Data Structures(Part 1)
Data Structures(Part 1)Data Structures(Part 1)
Data Structures(Part 1)
 
Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and tests
 
Linked List
Linked ListLinked List
Linked List
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.pptDATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
DATA STRUCTURE AND ALGORITJM POWERPOINT.ppt
 
Data Structure
Data StructureData Structure
Data Structure
 
Data Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptxData Structures and Algorithms - Lec 05.pptx
Data Structures and Algorithms - Lec 05.pptx
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using python
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
 
Data structure day1
Data structure day1Data structure day1
Data structure day1
 
Different types of Linked list.
Different types of Linked list.Different types of Linked list.
Different types of Linked list.
 
Data Structure
Data Structure Data Structure
Data Structure
 

More from RizwanBasha12

More from RizwanBasha12 (6)

UNIT-1.pptx
UNIT-1.pptxUNIT-1.pptx
UNIT-1.pptx
 
KEY MGMT.ppt
KEY MGMT.pptKEY MGMT.ppt
KEY MGMT.ppt
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
 
DES.ppt
DES.pptDES.ppt
DES.ppt
 
AES.pptx
AES.pptxAES.pptx
AES.pptx
 
CNS new ppt unit 1.pptx
CNS new ppt unit 1.pptxCNS new ppt unit 1.pptx
CNS new ppt unit 1.pptx
 

Recently uploaded

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

46267037-Data-Structures-PPT.ppt

  • 2. Agenda  Introduction  Arrays  Linked list  Single linked list  Double linked list  Stack  Queue
  • 3. Introduction Data Structure: a way to store and organize data in the structured manner. Computer's memory is divided into small parts, we use different data structures to store data in those small blocks. Example: Arrays, Linked list, Trees ..........
  • 4. Arrays  Array is basic data structure in which we store data in continues memory locations.  Array is variable which holds mulitiple elements of same type.  Arrays reduce the redendency  Generic form of arrays: data type array_name[size];  Data type: what type of data(int, float, char...)  Size: number elements you want to store
  • 5. Arrays  Every element will have index value  If you want to access any element we must use index value of the element.  Disadavantages:  Capable of holding only one type of elements.  Insertion and deletion is very difficult  Waste of memory is very high
  • 6. Linked list  Linked list: collection of nodes which or connected together  Node: is just like variable but it holds data and address of the next node or null.  Adavantages:  Memory efficincy is very high  Insertion and deletion is very easy and fast.
  • 7. Linked list  When linked list is useful:  Do not know the number of data elements  Your list need to be sorted quickly  Disadvantages:  Traversal is very slow  If you want to access 10th element in the list you need to cross 9 elements (arrays are very fast because of index)  You can move only in one direction in single linked list  If one link is corrupted remain data will be lost.
  • 8. Example program on linked list
  • 9. Double Linked list  In single linked we can move only in one direction  Double linked list allow us to move in direction.  Double linked is also collection of nodes, but here node is contains more than 2 fields.  Node: one field holds data, second field holds address of next node or null and third field holds address of previous node or null.
  • 10. Double linked list  Disadvantages:  Need extra space for holding references.  Still it is very slow to travel across the list.  Circular linked list:  If the head of linked list is connected to tail that list is called circular linked list.  Application of linked list:  Stacks and Queues.
  • 12. Stack  Stack  New nodes can be added and removed only at the top  Similar to a pile of dishes  Last-in, first-out (LIFO)  Bottom of stack indicated by a link member to NULL  Constrained version of a linked list
  • 13. Operations on Stack  push  Adds a new node to the top of the stack  pop  Removes a node from the top  Stores the popped value  Returns true if pop was successful
  • 14. Queue  Queue  Similar to a supermarket checkout line  First-in, first-out (FIFO)  Nodes are removed only from the head  Nodes are inserted only at the tail
  • 15. Operations on Queue  Insert and remove operations  Enqueue (insert) and dequeue (remove)  Disadvantages: What happens if you're 10th in line at the supermarket and it takes 5 minutes to process each person ahead of you? You wait 45 minutes.