SlideShare a Scribd company logo
I N T R O D U C T I O N T O D ATA
S T R U C T U R E S
N U R J A H A N N I PA
L E C T U R E R , D E P T O F I C T, B D U
LECTURE OUTLINES
• Basic Terminology
• Definition of data structure
• Types of data structures
• Data Structure Operations
• Algorithm
BASIC TERMINOLOGY
Data “Raw” facts, such as a telephone number, a birth date, a
customer name, and phone number. Data have little
meaning unless they have been organized in some
logical manner
Information Processed data. Information is used to reveal the
meaning of data.
Accurate, relevant, and timely information is the key to
good decision making.
Group Item Data items which have subordinate data items are
called Group item, for example, name of a student can
have first name and the last name.
Field Field is a smaller entity of the table which contains specific
information about every record in the table. In the example,
No, time, Temperature, difference, Measurement accuracy is
the field of that table.
Record A row of a table is also called record. It contains the specific
information of each individual entry in the table. It is a
horizontal entity in the table. For example, the fields 1,13.33,
29.30, 29.7, 0.40, 98.65 are the part of a record.
File A collection of related records. For example, a file might
contain data about the students currently enrolled at BDU.
Prepared By: Nurjahan Nipa 4
WHAT IS DATA STRUCTURE
• Data can be organized in many different ways; the logical or mathematical model of a
particular organization of data is called a data structure.
• Data structure is a method of organizing a large amount of data more efficiently so
that any operation on that data becomes easy.
• A data structure is a particular way of storing and organizing data either in computer’s
memory or on the disk storage so that it can be used efficiently.
• Data Structures are widely used in almost every aspect of Computer Science i.e. DBMS,
Operating System, Compiler Design, Artificial intelligence, Graphics and many more.
CHOICE OF PARTICULAR DATA MODEL
First, it must be rich enough in structure to mirror the actual relationships of the data
in real world.
On the other hand, the structure should be simple enough that one can effectively
process the data when necessary.
TYPES OF DATA STRUCTURE
1. Primitive Data structure: The primitive data structures are fundamental data types
that are supported by a programming language. The primitive data structure are also
called simple data structures. For example, integer, float, character, and Boolean are all
primitive data types.
2. Non-Primitive Data structure: Non-primitive data types are not defined by the
programming language, but are instead created by the programmer. The non-primitive
data types are used to store the group of values. Examples of the non-primitive data
types are Array, linked list, stacks, queue, tree, graphs etc.
TYPES OF DATA STRUCTURES
LINEAR AND NON LINEAR STRUCTURES
• Linear Data Structure: If the elements of a data structure are stored in a linear or
sequential order, then it is a linear data structure. Examples- Arrays, Linked Links,
Stacks, Queues.
• Non-Linear Data Structure: If the elements of a data structure are not stored in
sequential order, then it is a non-linear data structure. Examples- Trees and graphs.
GRAPH GRAPH TREE
STACK
QUEUE
Lecture 01 Intro to DSA
ARRAY
An array is a collection of items stored at contiguous memory locations. The idea is to
store multiple items of the same type together.
Arrays are of fixed size.
Data elements are stored in contiguous memory locations which may not be always
available.
Insertion and deletion of elements can be problematic because of shifting of elements
from
their positions.
Uses in Real life applications:
• 2D Arrays, generally called Matrices are mainly used in Image processing
• RGB image is a n*n*3 array
LINKED LISTS
Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not
stored at a contiguous location; the elements are linked using pointers.
• Music player- Songs in music player are linked to previous and next song.
• Previous and next page in web browser.
• Image viewer- Previous and next images are linked.
STACK
A stack is a linear data structure in which insertion and
deletion of elements are done at only ne end, which is known
as the top of the stack. Stack follows LIFO semantics i.e. the
last element which is added to the stack is the first element
which is deleted from the stack.
 Push: This term is used to insert an element into a stack.
 Pull: This term is used to delete an element into a stack.
Uses:
 Need to store undo/redo operation in a word process.
 Recursion
QUEUE
• A Queue is a linear list of elements in
which deletions can take place only at one
end, called the front, and insertions can
take place only at the other end, called the
rear.
• It is also called first-in-first-out (FIFO)
system.
Uses:
 To implement printer spooler.
TREE
• A tree is a non-linear data structure
which consists of a collection of nodes
arranged in a hierarchical order.
Examples of Real Life:
• Family tree
• Table of contents of a book
• Computer file system
GRAPH
• A graph is a non-linear data structure which is a
collection of vertices (also called nodes) and edges
that connect these vertices.
Real life uses of graph:
 Google Map
 Facebook
 World Wide Web
 Course Pre-requisite
 Circuit
 Computer Networks
OPERATIONS PERFORMED ON DATA
STRUCTURE
Operations Description
Insertion Adding a new record to the structure.
Deletion Removing an item from the structure.
Traversing Accessing and processing each data item of the data structure exactly once
Searching Find the location of the key value within the data structure.
Sorting Arranging all the data items in a data structure either in ascending or in
descending order or in lexicographical order (for Strings).
Merging Combining the data items of two different sorted lists into a single sorted list.
WHAT IS ALGORITHM
• An algorithm is a set of well-defined instructions in sequence to solve a problem. Algorithms
are generally created independent of underlying languages, i.e. an algorithm can be
implemented in more than one programming language.
Each algorithm should have five characteristics:
• Input: The algorithm must take zero or more input.
• Output: The algorithm may produce one or more outputs.
• Definiteness: Each step of algorithm must be defined unambiguously.
• Effectiveness: A human should be able to calculate the exact values involved in the
procedure of the algorithm using paper & pencil. It must be possible to perform each step
of the algorithm correctly and a finite amount of time. It is not enough that each step is
definite, but it must also be feasible.
• Termination: An algorithm may terminate after a finite number of steps
AN ALGORITHM FOR MAKING A CUP
OF TEA.
• Put the teabag in a cup.
• Fill the kettle with water.
• Boil the water in the kettle.
• Pour some of the boiled water into the cup.
• Add milk to the cup.
• Add sugar to the cup.
• Stir the tea.
• Drink the tea.
DESIGN AN ALGORITHM TO ADD TWO
NUMBERS AND DISPLAY THE RESULT
TIME & SPACE COMPLEXITY
The performance of an algorithm is measured on the basis of following properties :
• Time Complexity- Time complexity of an algorithm quantifies the amount of time
taken by an algorithm to run as a function of the length of the input.
• Space Complexity-Space complexity of an algorithm quantifies the amount of space or
memory taken by an algorithm to run as a function of the length of the input.
THANK YOU!
#include<stdio.h>
void function1(void);
void function2(void);
main()
{
int m=1000;
function2();
printf("%dn", m);
}
void function1(void)
{
int m=10;
printf("%dn", m);
}
void function2(void)
{
int m=100;
function1();
printf("%dn", m);
}

More Related Content

PPTX
Active database
PPTX
C++vs java
PPTX
Overview of UML Diagrams
PPTX
Software requirement and specification
PPT
Abstract class
PPTX
DBMS Integrity rule
PPTX
ER MODEL
PDF
Types of UML diagrams
Active database
C++vs java
Overview of UML Diagrams
Software requirement and specification
Abstract class
DBMS Integrity rule
ER MODEL
Types of UML diagrams

What's hot (20)

PPT
Collection Framework in java
PDF
Data flow diagrams - DFD
PPT
Stack a Data Structure
PPTX
Hashing in datastructure
PPTX
Requirement Analysis
PPTX
Queue in Data Structure
PDF
Software Engineering : Process Models
PPTX
introdution to SQL and SQL functions
PPTX
C# Arrays
PPT
Software Engineering Fundamentals
PPTX
Chapter 1 introduction to sql server
PPTX
What is ETL?
PPTX
ETL Testing Interview Questions and Answers
PPTX
Waterfall model ppt final
PPTX
System engineering
PPT
Unit 01 dbms
PPTX
Object oriented testing
PPT
10 component diagram
PPTX
System modeling
PPTX
Digital Search Tree
Collection Framework in java
Data flow diagrams - DFD
Stack a Data Structure
Hashing in datastructure
Requirement Analysis
Queue in Data Structure
Software Engineering : Process Models
introdution to SQL and SQL functions
C# Arrays
Software Engineering Fundamentals
Chapter 1 introduction to sql server
What is ETL?
ETL Testing Interview Questions and Answers
Waterfall model ppt final
System engineering
Unit 01 dbms
Object oriented testing
10 component diagram
System modeling
Digital Search Tree
Ad

Similar to Lecture 01 Intro to DSA (20)

PPT
DATA STRUCTURE AND ALGORITHMS
PDF
2. Introduction to Data Structure.pdf
DOCX
Data structure and algorithm.
PPTX
DSA - Copy.pptx
PPTX
Data_structures_and_algorithm_Lec_1.pptx
PPTX
Data_structures_and_algorithm_Lec_1.pptx
PPTX
DSA Ch1(Introduction) [Recovered].pptx
PPTX
1-Introduction to Data Structures beginner.pptx
PDF
Chapter 1 Introduction to Data Structures and Algorithms.pdf
PPTX
data structures module I & II.pptx
PPTX
Unit 1 dsuc
PDF
Unit-I PPT hususi sisooshsgv. Eijeieieooekejj
PPTX
Data structures - Introduction
PPT
Lecture 1 - Overview of Data Structure .ppt
PDF
Data structures introduction
PPTX
project on data structures and algorithm
PPT
1.1 introduction to Data Structures.ppt
PPTX
Data Structure using c language for beginners
PPT
ds 1 Introduction to Data Structures.ppt
PPTX
Introduction to Data Structure
DATA STRUCTURE AND ALGORITHMS
2. Introduction to Data Structure.pdf
Data structure and algorithm.
DSA - Copy.pptx
Data_structures_and_algorithm_Lec_1.pptx
Data_structures_and_algorithm_Lec_1.pptx
DSA Ch1(Introduction) [Recovered].pptx
1-Introduction to Data Structures beginner.pptx
Chapter 1 Introduction to Data Structures and Algorithms.pdf
data structures module I & II.pptx
Unit 1 dsuc
Unit-I PPT hususi sisooshsgv. Eijeieieooekejj
Data structures - Introduction
Lecture 1 - Overview of Data Structure .ppt
Data structures introduction
project on data structures and algorithm
1.1 introduction to Data Structures.ppt
Data Structure using c language for beginners
ds 1 Introduction to Data Structures.ppt
Introduction to Data Structure
Ad

Recently uploaded (20)

PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
ETO & MEO Certificate of Competency Questions and Answers
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
Welding lecture in detail for understanding
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PDF
Digital Logic Computer Design lecture notes
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPT
Drone Technology Electronics components_1
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Lesson 3_Tessellation.pptx finite Mathematics
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
ETO & MEO Certificate of Competency Questions and Answers
Arduino robotics embedded978-1-4302-3184-4.pdf
Construction Project Organization Group 2.pptx
Welding lecture in detail for understanding
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Digital Logic Computer Design lecture notes
Operating System & Kernel Study Guide-1 - converted.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Foundation to blockchain - A guide to Blockchain Tech
Embodied AI: Ushering in the Next Era of Intelligent Systems
Drone Technology Electronics components_1

Lecture 01 Intro to DSA

  • 1. I N T R O D U C T I O N T O D ATA S T R U C T U R E S N U R J A H A N N I PA L E C T U R E R , D E P T O F I C T, B D U
  • 2. LECTURE OUTLINES • Basic Terminology • Definition of data structure • Types of data structures • Data Structure Operations • Algorithm
  • 3. BASIC TERMINOLOGY Data “Raw” facts, such as a telephone number, a birth date, a customer name, and phone number. Data have little meaning unless they have been organized in some logical manner Information Processed data. Information is used to reveal the meaning of data. Accurate, relevant, and timely information is the key to good decision making. Group Item Data items which have subordinate data items are called Group item, for example, name of a student can have first name and the last name.
  • 4. Field Field is a smaller entity of the table which contains specific information about every record in the table. In the example, No, time, Temperature, difference, Measurement accuracy is the field of that table. Record A row of a table is also called record. It contains the specific information of each individual entry in the table. It is a horizontal entity in the table. For example, the fields 1,13.33, 29.30, 29.7, 0.40, 98.65 are the part of a record. File A collection of related records. For example, a file might contain data about the students currently enrolled at BDU. Prepared By: Nurjahan Nipa 4
  • 5. WHAT IS DATA STRUCTURE • Data can be organized in many different ways; the logical or mathematical model of a particular organization of data is called a data structure. • Data structure is a method of organizing a large amount of data more efficiently so that any operation on that data becomes easy. • A data structure is a particular way of storing and organizing data either in computer’s memory or on the disk storage so that it can be used efficiently. • Data Structures are widely used in almost every aspect of Computer Science i.e. DBMS, Operating System, Compiler Design, Artificial intelligence, Graphics and many more.
  • 6. CHOICE OF PARTICULAR DATA MODEL First, it must be rich enough in structure to mirror the actual relationships of the data in real world. On the other hand, the structure should be simple enough that one can effectively process the data when necessary.
  • 7. TYPES OF DATA STRUCTURE 1. Primitive Data structure: The primitive data structures are fundamental data types that are supported by a programming language. The primitive data structure are also called simple data structures. For example, integer, float, character, and Boolean are all primitive data types. 2. Non-Primitive Data structure: Non-primitive data types are not defined by the programming language, but are instead created by the programmer. The non-primitive data types are used to store the group of values. Examples of the non-primitive data types are Array, linked list, stacks, queue, tree, graphs etc.
  • 8. TYPES OF DATA STRUCTURES
  • 9. LINEAR AND NON LINEAR STRUCTURES • Linear Data Structure: If the elements of a data structure are stored in a linear or sequential order, then it is a linear data structure. Examples- Arrays, Linked Links, Stacks, Queues. • Non-Linear Data Structure: If the elements of a data structure are not stored in sequential order, then it is a non-linear data structure. Examples- Trees and graphs.
  • 12. ARRAY An array is a collection of items stored at contiguous memory locations. The idea is to store multiple items of the same type together.
  • 13. Arrays are of fixed size. Data elements are stored in contiguous memory locations which may not be always available. Insertion and deletion of elements can be problematic because of shifting of elements from their positions. Uses in Real life applications: • 2D Arrays, generally called Matrices are mainly used in Image processing • RGB image is a n*n*3 array
  • 14. LINKED LISTS Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at a contiguous location; the elements are linked using pointers. • Music player- Songs in music player are linked to previous and next song. • Previous and next page in web browser. • Image viewer- Previous and next images are linked.
  • 15. STACK A stack is a linear data structure in which insertion and deletion of elements are done at only ne end, which is known as the top of the stack. Stack follows LIFO semantics i.e. the last element which is added to the stack is the first element which is deleted from the stack.  Push: This term is used to insert an element into a stack.  Pull: This term is used to delete an element into a stack. Uses:  Need to store undo/redo operation in a word process.  Recursion
  • 16. QUEUE • A Queue is a linear list of elements in which deletions can take place only at one end, called the front, and insertions can take place only at the other end, called the rear. • It is also called first-in-first-out (FIFO) system. Uses:  To implement printer spooler.
  • 17. TREE • A tree is a non-linear data structure which consists of a collection of nodes arranged in a hierarchical order. Examples of Real Life: • Family tree • Table of contents of a book • Computer file system
  • 18. GRAPH • A graph is a non-linear data structure which is a collection of vertices (also called nodes) and edges that connect these vertices. Real life uses of graph:  Google Map  Facebook  World Wide Web  Course Pre-requisite  Circuit  Computer Networks
  • 19. OPERATIONS PERFORMED ON DATA STRUCTURE Operations Description Insertion Adding a new record to the structure. Deletion Removing an item from the structure. Traversing Accessing and processing each data item of the data structure exactly once Searching Find the location of the key value within the data structure. Sorting Arranging all the data items in a data structure either in ascending or in descending order or in lexicographical order (for Strings). Merging Combining the data items of two different sorted lists into a single sorted list.
  • 20. WHAT IS ALGORITHM • An algorithm is a set of well-defined instructions in sequence to solve a problem. Algorithms are generally created independent of underlying languages, i.e. an algorithm can be implemented in more than one programming language. Each algorithm should have five characteristics: • Input: The algorithm must take zero or more input. • Output: The algorithm may produce one or more outputs. • Definiteness: Each step of algorithm must be defined unambiguously. • Effectiveness: A human should be able to calculate the exact values involved in the procedure of the algorithm using paper & pencil. It must be possible to perform each step of the algorithm correctly and a finite amount of time. It is not enough that each step is definite, but it must also be feasible. • Termination: An algorithm may terminate after a finite number of steps
  • 21. AN ALGORITHM FOR MAKING A CUP OF TEA. • Put the teabag in a cup. • Fill the kettle with water. • Boil the water in the kettle. • Pour some of the boiled water into the cup. • Add milk to the cup. • Add sugar to the cup. • Stir the tea. • Drink the tea.
  • 22. DESIGN AN ALGORITHM TO ADD TWO NUMBERS AND DISPLAY THE RESULT
  • 23. TIME & SPACE COMPLEXITY The performance of an algorithm is measured on the basis of following properties : • Time Complexity- Time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input. • Space Complexity-Space complexity of an algorithm quantifies the amount of space or memory taken by an algorithm to run as a function of the length of the input.
  • 25. #include<stdio.h> void function1(void); void function2(void); main() { int m=1000; function2(); printf("%dn", m); } void function1(void) { int m=10; printf("%dn", m); } void function2(void) { int m=100; function1(); printf("%dn", m); }