SlideShare a Scribd company logo
1 of 25
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
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

What's hot

Data structures (introduction)
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)Arvind Devaraj
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithmsiqbalphy1
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueGhaffar Khan
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Poojith Chowdhary
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structureZaid Shabbir
 
data structure
data structuredata structure
data structurehashim102
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation Anil Kumar Prajapati
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)Elavarasi K
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsHoang Nguyen
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.Education Front
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Hassan Ahmed
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structureeShikshak
 
2nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 12nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 1Aahwini Esware gowda
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureRai University
 

What's hot (20)

Data structure
Data structureData structure
Data structure
 
Data structures using C
Data structures using CData structures using C
Data structures using C
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Data structures (introduction)
 Data structures (introduction) Data structures (introduction)
Data structures (introduction)
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
Introductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, QueueIntroductiont To Aray,Tree,Stack, Queue
Introductiont To Aray,Tree,Stack, Queue
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
data structure
data structuredata structure
data structure
 
Data structure power point presentation
Data structure power point presentation Data structure power point presentation
Data structure power point presentation
 
Data Structures (CS8391)
Data Structures (CS8391)Data Structures (CS8391)
Data Structures (CS8391)
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Introduction To Data Structures.
Introduction To Data Structures.Introduction To Data Structures.
Introduction To Data Structures.
 
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...Data structure,abstraction,abstract data type,static and dynamic,time and spa...
Data structure,abstraction,abstract data type,static and dynamic,time and spa...
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structure
 
2nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 12nd puc computer science chapter 3 data structures 1
2nd puc computer science chapter 3 data structures 1
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Data Structure Basics
Data Structure BasicsData Structure Basics
Data Structure Basics
 
Data Structures
Data StructuresData Structures
Data Structures
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
 

Similar to Lecture 01 Intro to DSA

Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptxKami503928
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)Madishetty Prathibha
 
Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]Muhammad Hammad Waseem
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data StructuresAmar Jukuntla
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structuresunilchute1
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structuresunilchute1
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxOnkarModhave
 
Lecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionLecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionAbirami A
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptxclassall
 
1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptx1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptxRahikAhmed
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHISowmya Jyothi
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.pptclassall
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptxclassall
 
Lecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxLecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxArifKamal36
 
Unit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxUnit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxajajkhan16
 

Similar to Lecture 01 Intro to DSA (20)

Data structure chapter 1.pptx
Data structure chapter 1.pptxData structure chapter 1.pptx
Data structure chapter 1.pptx
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
dsa.pptx
dsa.pptxdsa.pptx
dsa.pptx
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]Data Structures - Lecture 2 [Introduction to Data Structures]
Data Structures - Lecture 2 [Introduction to Data Structures]
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptx
 
Lecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionLecture 2 Data Structure Introduction
Lecture 2 Data Structure Introduction
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 
Data structures
Data structuresData structures
Data structures
 
1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptx1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptx
 
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHIBCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
BCA DATA STRUCTURES INTRODUCTION AND OVERVIEW SOWMYA JYOTHI
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.ppt
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 
ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
 
Lecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptxLecture 1. Data Structure & Algorithm.pptx
Lecture 1. Data Structure & Algorithm.pptx
 
Unit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxUnit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptx
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

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.
  • 11.
  • 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); }