SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
Lecture - 1
      on
Data Structures
Data Type and Data Structure

Data type
     •Set of possible values for variables
     •Operations on those values
Ex : int, float, char ……….

Data Structure
A data structure is an arrangement of data in a computer's memory
or even disk storage.
The logical and mathematical model of a particular organization of
data is called a data structure.
A data structure is a particular way of storing and organizing data
in a computer so that it can be used efficiently.
An example of several common data structures:
     • arrays,
     •linked lists,
     •stacks,
     •queues,
     • trees,
     •and Graph
Data structure lecture 1
Array
Linear array (One dimensional array) : A list of finite number n of similar data
elements referenced respectively by a set of n consecutive numbers, usually 1,
2, 3,…..n. That is a specific element is accessed by an index.
Let, Array name is A then the elements of A is : a1,a2….. an
Or by the bracket notation A[1], A[2], A[3],…………., A[n]
The number k in A[k] is called a subscript and A[k] is called a subscripted
variable.




                                                               element
Example
A linear array STUDENT consisting of the name of six students

                            STUDENT
                   1    Dalia Rahaman
                   2    Sumona
                   3    Mubtasim Fuad
                   4
                        Anamul Haque
                   5
                        Ibtisam Rahaman
                   6
                        Jarin



                Here, STUDENT[4] denote Anamul Haque
Array (con…)
Linear arrays are called one dimensional arrays because each
element in such an array is referenced by one subscript.
 (Two dimensional array) : Two dimensional array is a collection of
similar data elements where each element is referenced by two
subscripts.
Such arrays are called matrices in mathematics and tables in
business applications.
Multidimensional arrays are defined analogously
              MATRICES
          1       2   3     4
  1   1       2       3    4
                                       Here, MATRICES[3,3]=11
  2   5       6       7    8
  3   9       10      11   12
  4   13      14      15   16
Array Data Structure
It can hold multiple values of a single type.
Elements are referenced by the array name and an ordinal index.
Each element is a value
Indexing begins at zero.
The array forms a contiguous list in memory.
The name of the array holds the address of the first array element.
We specify the array size at compile time, often with a named constant.
Linked lists
  •A linked list, or one way list, is a linear collection of data
  elements, called nodes, where the linear order is given by means
  of pointers.

  •Dynamically allocate space for each element as needed.


                     Node

                  Data      Next

In linked list
     Each node of the list contains the data item
         a pointer to the next node

Collection structure has a pointer to the list Start
    Initially NULL
                      Start

                    Prepared by, Jesmin Akhter,
                          Lecturer, IIT,JU
Linked lists

Start


            node
                                             node
               Data       Next                Data


                  Linked list with 2 nodes




        Prepared by, Jesmin Akhter,
              Lecturer, IIT,JU
Linked lists
            INFO   LINK

START   1                  START=3, INFO[3]=M

 3      2   A      5       LINK[3]=2, INFO[2]=A

        3   M      2       LINK[2]=5, INFO[5]=N
                           LINK[5]=4, INFO[4]=G
        4   G      7
                           LINK[4]=7, INFO[7]=O
        5   N      4
                           LINK[7]=0, NULL value, So the list has ended
        6
        7   O      0

        8
Stacks
• Stacks are a special form of collection
  with LIFO semantics
• Two methods
     - add item to the top of the stack
     - remove an item from the top of the stack
• Like a plate stacker
Queues

• Like a stack, a queue is also a list. However,
  with a queue, insertion is done at one end, while
  deletion is performed at the other end
• The insertion end is called rear
   – The deletion end is called front



  Remove                                   Insert
            front                   rear
edges
Data structure lecture 1
Data structure lecture 1
Data structure operations
The data appearing in our data structure is processed by means of certain
operations. In fact, the particular data structure that one chooses for a given
situation depends largely on the frequency with which specific operations are
performed. The following four operations play a major role:

Traversing
Accessing each record exactly once so that certain items in the record may
be processed. (This accessing or processing is sometimes called 'visiting"
the records.)

Searching
Finding the location of the record with a given key value, or finding the
locations of all records, which satisfy one or more conditions.

Inserting
Adding new records to the structure.

Deleting
Removing a record from the structure.
Data structure operations (Continued)

The following two operations, which are used in special situations, will also be
considered:
Sorting:
Arranging the records in some logical order
Merging:
Combining the records in two different sorted files into a single sorted files
Algorithms
An essential aspect to data structures is algorithms. Data structures
are implemented using algorithms.
An Algorithm is a finite step – by – step list of well defined instructions
for solving a particular problem. It is used to manipulate the data
contained in the data structures as in searching and sorting. It states
explicitly how the data will be manipulated.

            Perform data structure operations
Complexity


The complexity of an algorithm is a function describing the efficiency of the
algorithm in terms of the amount of data the algorithm must process. There
are two main complexity measures of the efficiency of an algorithm:

Time complexity is a function describing the amount of time an algorithm
takes in terms of the amount of input to the algorithm.

Space complexity is a function describing the amount of memory (space) an
algorithm takes in terms of the amount of input to the algorithm.
Discussion
•Once data is organized into forms such as trees, stacks and queues,
standard algorithms can be used to process them.

•Properly organized data lead to easy-to understand user interfaces

More Related Content

PDF
Data structure ppt
Prof. Dr. K. Adisesha
 
PPT
Introduction to Matlab
aman gupta
 
PDF
Modular Programming in C
bhawna kol
 
PPTX
Microbes and diseases
Sagar Divetiya
 
PPT
Elmasri Navathe DBMS Unit-1 ppt
AbhinavPandey274499
 
PPT
أساليب تشفير البيانات، بناء مقاطع التشفير
Omar Alabri
 
PPTX
Big data ppt
Nasrin Hussain
 
PPTX
امن نظم المعلومات وامن الشبكات
Amr Rashed
 
Data structure ppt
Prof. Dr. K. Adisesha
 
Introduction to Matlab
aman gupta
 
Modular Programming in C
bhawna kol
 
Microbes and diseases
Sagar Divetiya
 
Elmasri Navathe DBMS Unit-1 ppt
AbhinavPandey274499
 
أساليب تشفير البيانات، بناء مقاطع التشفير
Omar Alabri
 
Big data ppt
Nasrin Hussain
 
امن نظم المعلومات وامن الشبكات
Amr Rashed
 

What's hot (20)

PPT
Unit 1 introduction to data structure
kalyanineve
 
PPTX
linked list in data structure
shameen khan
 
PPTX
Sorting Algorithms
Pranay Neema
 
PPTX
Data structures and algorithms
Julie Iskander
 
PPTX
Doubly Linked List
Ninad Mankar
 
PPTX
Breadth First Search & Depth First Search
Kevin Jadiya
 
PPTX
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
PPTX
Arrays in Data Structure and Algorithm
KristinaBorooah
 
PPT
Linked lists
SARITHA REDDY
 
PPTX
Quick sort-Data Structure
Jeanie Arnoco
 
PPTX
Queues
Ashim Lamichhane
 
PPTX
classes and objects in C++
HalaiHansaika
 
PPT
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
PPTX
Data structure & its types
Rameesha Sadaqat
 
PPTX
Hashing Technique In Data Structures
SHAKOOR AB
 
PPT
Data structures using c
Prof. Dr. K. Adisesha
 
PPTX
Data structure using c module 1
smruti sarangi
 
PPTX
Insertion sort
almaqboli
 
PPTX
Recursion
Abdur Rehman
 
PPT
Data Structures and Algorithm Analysis
Mary Margarat
 
Unit 1 introduction to data structure
kalyanineve
 
linked list in data structure
shameen khan
 
Sorting Algorithms
Pranay Neema
 
Data structures and algorithms
Julie Iskander
 
Doubly Linked List
Ninad Mankar
 
Breadth First Search & Depth First Search
Kevin Jadiya
 
Data Structure and Algorithms.pptx
Syed Zaid Irshad
 
Arrays in Data Structure and Algorithm
KristinaBorooah
 
Linked lists
SARITHA REDDY
 
Quick sort-Data Structure
Jeanie Arnoco
 
classes and objects in C++
HalaiHansaika
 
SEARCHING AND SORTING ALGORITHMS
Gokul Hari
 
Data structure & its types
Rameesha Sadaqat
 
Hashing Technique In Data Structures
SHAKOOR AB
 
Data structures using c
Prof. Dr. K. Adisesha
 
Data structure using c module 1
smruti sarangi
 
Insertion sort
almaqboli
 
Recursion
Abdur Rehman
 
Data Structures and Algorithm Analysis
Mary Margarat
 
Ad

Viewers also liked (20)

PPTX
Data Structures - Lecture 7 [Linked List]
Muhammad Hammad Waseem
 
PPT
Data structure lecture 2
Kumar
 
PDF
01 05 - introduction xml
Siva Kumar reddy Vasipally
 
PDF
linked list
Abbott
 
PPT
L6 structure
mondalakash2012
 
PPT
Introduction to data structure by anil dutt
Anil Dutt
 
PPTX
‫Chapter3 inheritance
Mahmoud Alfarra
 
PPTX
Method overloading
Lovely Professional University
 
PPTX
5 Array List, data structure course
Mahmoud Alfarra
 
PDF
3 Array operations
Mahmoud Alfarra
 
PDF
Data Structure (Introduction to Data Structure)
Adam Mukharil Bachtiar
 
PPTX
Data structures
Lovely Professional University
 
PPTX
Mca ii dfs u-1 introduction to data structure
Rai University
 
PPTX
Trees data structure
Mahmoud Alfarra
 
PPTX
Graphs data Structure
Mahmoud Alfarra
 
PPTX
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Hassan Ahmed
 
PPT
Basic data-structures-v.1.1
BG Java EE Course
 
PPTX
Data structure & algorithms introduction
Sugandh Wafai
 
PDF
data structure and algorithms
ibrar ahmad
 
PPTX
‫‫Chapter4 Polymorphism
Mahmoud Alfarra
 
Data Structures - Lecture 7 [Linked List]
Muhammad Hammad Waseem
 
Data structure lecture 2
Kumar
 
01 05 - introduction xml
Siva Kumar reddy Vasipally
 
linked list
Abbott
 
L6 structure
mondalakash2012
 
Introduction to data structure by anil dutt
Anil Dutt
 
‫Chapter3 inheritance
Mahmoud Alfarra
 
Method overloading
Lovely Professional University
 
5 Array List, data structure course
Mahmoud Alfarra
 
3 Array operations
Mahmoud Alfarra
 
Data Structure (Introduction to Data Structure)
Adam Mukharil Bachtiar
 
Mca ii dfs u-1 introduction to data structure
Rai University
 
Trees data structure
Mahmoud Alfarra
 
Graphs data Structure
Mahmoud Alfarra
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Hassan Ahmed
 
Basic data-structures-v.1.1
BG Java EE Course
 
Data structure & algorithms introduction
Sugandh Wafai
 
data structure and algorithms
ibrar ahmad
 
‫‫Chapter4 Polymorphism
Mahmoud Alfarra
 
Ad

Similar to Data structure lecture 1 (20)

DOCX
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Malikireddy Bramhananda Reddy
 
PPT
Ds it203-11-l01
Chyon Ju
 
PPTX
Data Structure Introduction- Arrays, Matrix, Linked List
JasmineJinitha
 
PDF
M v bramhananda reddy dsa complete notes
Malikireddy Bramhananda Reddy
 
PPTX
Unit 2 linear data structures
Senthil Murugan
 
PPTX
project on data structures and algorithm
AnujKumar566766
 
PPTX
Introduction to Data Structures and their importance
Bulbul Agrawal
 
PDF
cluod.pdf
ssuser92d367
 
PPTX
unit 2.pptx
researchgrad82
 
PDF
8074.pdf
BAna36
 
PPTX
Data Structure and Algorithms by Sabeen Memon03.pptx
msoomar8611
 
PDF
DATA STRUCTURES USING C -ENGGDIGEST
Swapnil Mishra
 
PDF
lect 2-DS ALGO(online).pdf
MuhammadUmerIhtisham
 
PPTX
DS Module 1.pptx
SaralaT3
 
PDF
2. Introduction to Data Structure.pdf
SulabhPawaia
 
PPTX
DS Module 1.pptx
sarala9
 
PPTX
DataStructurePpt.pptx
ssuser031f35
 
PPT
1 list datastructures
Nguync91368
 
PDF
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
Sowmya Jyothi
 
PDF
numpy.pdf
DrSudheerHanumanthak
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Malikireddy Bramhananda Reddy
 
Ds it203-11-l01
Chyon Ju
 
Data Structure Introduction- Arrays, Matrix, Linked List
JasmineJinitha
 
M v bramhananda reddy dsa complete notes
Malikireddy Bramhananda Reddy
 
Unit 2 linear data structures
Senthil Murugan
 
project on data structures and algorithm
AnujKumar566766
 
Introduction to Data Structures and their importance
Bulbul Agrawal
 
cluod.pdf
ssuser92d367
 
unit 2.pptx
researchgrad82
 
8074.pdf
BAna36
 
Data Structure and Algorithms by Sabeen Memon03.pptx
msoomar8611
 
DATA STRUCTURES USING C -ENGGDIGEST
Swapnil Mishra
 
lect 2-DS ALGO(online).pdf
MuhammadUmerIhtisham
 
DS Module 1.pptx
SaralaT3
 
2. Introduction to Data Structure.pdf
SulabhPawaia
 
DS Module 1.pptx
sarala9
 
DataStructurePpt.pptx
ssuser031f35
 
1 list datastructures
Nguync91368
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
Sowmya Jyothi
 

More from Kumar (20)

PPT
Graphics devices
Kumar
 
PPT
Fill area algorithms
Kumar
 
PDF
region-filling
Kumar
 
PDF
Bresenham derivation
Kumar
 
PPT
Bresenham circles and polygons derication
Kumar
 
PPTX
Introductionto xslt
Kumar
 
PPTX
Extracting data from xml
Kumar
 
PPTX
Xml basics
Kumar
 
PPTX
XML Schema
Kumar
 
PPTX
Publishing xml
Kumar
 
PPTX
DTD
Kumar
 
PPTX
Applying xml
Kumar
 
PPTX
Introduction to XML
Kumar
 
PDF
How to deploy a j2ee application
Kumar
 
PDF
JNDI, JMS, JPA, XML
Kumar
 
PDF
EJB Fundmentals
Kumar
 
PDF
JSP and struts programming
Kumar
 
PDF
java servlet and servlet programming
Kumar
 
PDF
Introduction to JDBC and JDBC Drivers
Kumar
 
PDF
Introduction to J2EE
Kumar
 
Graphics devices
Kumar
 
Fill area algorithms
Kumar
 
region-filling
Kumar
 
Bresenham derivation
Kumar
 
Bresenham circles and polygons derication
Kumar
 
Introductionto xslt
Kumar
 
Extracting data from xml
Kumar
 
Xml basics
Kumar
 
XML Schema
Kumar
 
Publishing xml
Kumar
 
DTD
Kumar
 
Applying xml
Kumar
 
Introduction to XML
Kumar
 
How to deploy a j2ee application
Kumar
 
JNDI, JMS, JPA, XML
Kumar
 
EJB Fundmentals
Kumar
 
JSP and struts programming
Kumar
 
java servlet and servlet programming
Kumar
 
Introduction to JDBC and JDBC Drivers
Kumar
 
Introduction to J2EE
Kumar
 

Recently uploaded (20)

PDF
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PDF
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
NewMind AI Monthly Chronicles - July 2025
NewMind AI
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
famaw19526
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
Google’s NotebookLM Unveils Video Overviews
SOFTTECHHUB
 
This slide provides an overview Technology
mineshkharadi333
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
NewMind AI Monthly Chronicles - July 2025
NewMind AI
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Doc9.....................................
SofiaCollazos
 
Test Bank, Solutions for Java How to Program, An Objects-Natural Approach, 12...
famaw19526
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 

Data structure lecture 1

  • 1. Lecture - 1 on Data Structures
  • 2. Data Type and Data Structure Data type •Set of possible values for variables •Operations on those values Ex : int, float, char ………. Data Structure A data structure is an arrangement of data in a computer's memory or even disk storage. The logical and mathematical model of a particular organization of data is called a data structure. A data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.
  • 3. An example of several common data structures: • arrays, •linked lists, •stacks, •queues, • trees, •and Graph
  • 5. Array Linear array (One dimensional array) : A list of finite number n of similar data elements referenced respectively by a set of n consecutive numbers, usually 1, 2, 3,…..n. That is a specific element is accessed by an index. Let, Array name is A then the elements of A is : a1,a2….. an Or by the bracket notation A[1], A[2], A[3],…………., A[n] The number k in A[k] is called a subscript and A[k] is called a subscripted variable. element
  • 6. Example A linear array STUDENT consisting of the name of six students STUDENT 1 Dalia Rahaman 2 Sumona 3 Mubtasim Fuad 4 Anamul Haque 5 Ibtisam Rahaman 6 Jarin Here, STUDENT[4] denote Anamul Haque
  • 7. Array (con…) Linear arrays are called one dimensional arrays because each element in such an array is referenced by one subscript. (Two dimensional array) : Two dimensional array is a collection of similar data elements where each element is referenced by two subscripts. Such arrays are called matrices in mathematics and tables in business applications. Multidimensional arrays are defined analogously MATRICES 1 2 3 4 1 1 2 3 4 Here, MATRICES[3,3]=11 2 5 6 7 8 3 9 10 11 12 4 13 14 15 16
  • 8. Array Data Structure It can hold multiple values of a single type. Elements are referenced by the array name and an ordinal index. Each element is a value Indexing begins at zero. The array forms a contiguous list in memory. The name of the array holds the address of the first array element. We specify the array size at compile time, often with a named constant.
  • 9. Linked lists •A linked list, or one way list, is a linear collection of data elements, called nodes, where the linear order is given by means of pointers. •Dynamically allocate space for each element as needed. Node Data Next In linked list Each node of the list contains the data item a pointer to the next node Collection structure has a pointer to the list Start Initially NULL Start Prepared by, Jesmin Akhter, Lecturer, IIT,JU
  • 10. Linked lists Start node node Data Next Data Linked list with 2 nodes Prepared by, Jesmin Akhter, Lecturer, IIT,JU
  • 11. Linked lists INFO LINK START 1 START=3, INFO[3]=M 3 2 A 5 LINK[3]=2, INFO[2]=A 3 M 2 LINK[2]=5, INFO[5]=N LINK[5]=4, INFO[4]=G 4 G 7 LINK[4]=7, INFO[7]=O 5 N 4 LINK[7]=0, NULL value, So the list has ended 6 7 O 0 8
  • 12. Stacks • Stacks are a special form of collection with LIFO semantics • Two methods - add item to the top of the stack - remove an item from the top of the stack • Like a plate stacker
  • 13. Queues • Like a stack, a queue is also a list. However, with a queue, insertion is done at one end, while deletion is performed at the other end • The insertion end is called rear – The deletion end is called front Remove Insert front rear
  • 14. edges
  • 17. Data structure operations The data appearing in our data structure is processed by means of certain operations. In fact, the particular data structure that one chooses for a given situation depends largely on the frequency with which specific operations are performed. The following four operations play a major role: Traversing Accessing each record exactly once so that certain items in the record may be processed. (This accessing or processing is sometimes called 'visiting" the records.) Searching Finding the location of the record with a given key value, or finding the locations of all records, which satisfy one or more conditions. Inserting Adding new records to the structure. Deleting Removing a record from the structure.
  • 18. Data structure operations (Continued) The following two operations, which are used in special situations, will also be considered: Sorting: Arranging the records in some logical order Merging: Combining the records in two different sorted files into a single sorted files
  • 19. Algorithms An essential aspect to data structures is algorithms. Data structures are implemented using algorithms. An Algorithm is a finite step – by – step list of well defined instructions for solving a particular problem. It is used to manipulate the data contained in the data structures as in searching and sorting. It states explicitly how the data will be manipulated. Perform data structure operations
  • 20. Complexity The complexity of an algorithm is a function describing the efficiency of the algorithm in terms of the amount of data the algorithm must process. There are two main complexity measures of the efficiency of an algorithm: Time complexity is a function describing the amount of time an algorithm takes in terms of the amount of input to the algorithm. Space complexity is a function describing the amount of memory (space) an algorithm takes in terms of the amount of input to the algorithm.
  • 21. Discussion •Once data is organized into forms such as trees, stacks and queues, standard algorithms can be used to process them. •Properly organized data lead to easy-to understand user interfaces