SlideShare a Scribd company logo
Introduction to
Data Structure and Algorithm
Presented By: Pratik Mota
Objectives
 Basics of Data Structure and Algorithm
 Practical Examples of where Data Structure Algorithms is used
 Asymptotic Notations [ O(n), o(n), θ(n), Ω(n), ω(n) ]
 Time and Space Complexity
 GNU gprof basic
Basics of Data structure and Algorithm
 Data structure is a particular way of storing and organizing data in a computer so that it can be
used efficiently.
 Some Well-know Data structure
1) Array
2) List [Singly and Doubly Linked List]
3) Tree [ Binary,AVL, Red Black..etc ]
4) B+ Tree
5) Heap [ Max and Min Heap ]
6) Hashing
7) Graph [ BFS, DFS,..etc ]
Basics of Data structure and Algorithm
Algorithm is a step-by-step procedure for calculations OR you can tell it is sequence of
program instructions designed to compute a particular result.
 Examples:- Sorting, Searching, Shortest Path, Dynamic Programming, Numerical Algorithms
etc..
Sort
INPUT
sequence of numbers
a1, a2, a3,….,an
b1,b2,b3,….,bn
OUTPUT
a permutation of the
sequence of numbers
2 5 4 10 7 2 4 5 7 10
Sorting Algorithm
Use of Data Structure and Algorithm
Practical Examples (Cont.)
Practical Examples (Cont.)
Asymptotic Notations
1n
2n
3n
4n
5n
6n
Runningtime
1 2 3 4 5 6 7 8 9 10 11 12 …..
best-case Ω(n)
average-case θ(n)
worst-case O(n)
Input instance size
o(n)
ω(n)
Basics of Complexity
O(1) < O(log n ) < O(n) < O(n log n ) < O(n^2) < ….. < O(n^k) < O(2^n)
O( n^2 + n + 1 ) => O(n^2)  MAX ( f(n), g(n) )
 O(N + a)^b  O(N^b)
Time Complexity :- Amount of time taken by an algorithm to run.
Space Complexity:- Extra/Temporary Space use by algorithm .
Time and Space Complexity
O(n) O(n^2) O( log n )
GNU gprof
 Gprof is a profiling program which collects performance statistics of our programs.
 For Performance analysis -pg option needed for GCC / g++ Compiler.
Ex:- g++ -pg gprof_test.cpp -o gprof_test
 After running ./gprof_test , It generates gmon.out file.
 gmon.out file contain Performance analysis statistics, which can be analyze using
gprof tool. Ex:- gprof gprof_test gmon.out > analysis.txt
 It provides mainly two type of Performance Analysis
1) Flat Profile [ Total amount of time your program spent executing each function ]
2) Call graph [ How much time was spent in each function and its children ]
Introduction to datastructure and algorithm

More Related Content

PDF
Arrays in python
PPTX
Artificial intelligence agents and environment
PDF
Data structures
PPTX
Machine learning introduction
PPTX
Text similarity measures
PPTX
First order logic
PPT
Time complexity
PPTX
Content provider in_android
Arrays in python
Artificial intelligence agents and environment
Data structures
Machine learning introduction
Text similarity measures
First order logic
Time complexity
Content provider in_android

What's hot (20)

PPTX
Queue in Data Structure
PDF
Python Flow Control
PPTX
Python Scipy Numpy
PPT
Data structure lecture 1
PPTX
Chapter 09 design and analysis of algorithms
PPTX
Data structure and algorithm
PPT
Merge sort
PPTX
Binary search
PDF
Quick sort algorithn
PPTX
Searching
PPT
Chapter 6 Intermediate Code Generation
PDF
State Space Search in ai
PPT
Introduction to Natural Language Processing
PDF
Introduction to Machine Learning with SciKit-Learn
PPTX
Arrays in Data Structure and Algorithm
PPTX
Data Structures in Python
PPTX
information retrieval Techniques and normalization
PPT
Graph coloring problem
PPTX
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
PPTX
10. Search Tree - Data Structures using C++ by Varsha Patil
Queue in Data Structure
Python Flow Control
Python Scipy Numpy
Data structure lecture 1
Chapter 09 design and analysis of algorithms
Data structure and algorithm
Merge sort
Binary search
Quick sort algorithn
Searching
Chapter 6 Intermediate Code Generation
State Space Search in ai
Introduction to Natural Language Processing
Introduction to Machine Learning with SciKit-Learn
Arrays in Data Structure and Algorithm
Data Structures in Python
information retrieval Techniques and normalization
Graph coloring problem
Machine Learning Tutorial Part - 1 | Machine Learning Tutorial For Beginners ...
10. Search Tree - Data Structures using C++ by Varsha Patil
Ad

Viewers also liked (7)

PPTX
Major Types of Research
PPT
Introduction to data structures and Algorithm
PPTX
Types of research
PPSX
Types of Research Designs RS Mehta
PPT
Definition and types of research
Major Types of Research
Introduction to data structures and Algorithm
Types of research
Types of Research Designs RS Mehta
Definition and types of research
Ad

Similar to Introduction to datastructure and algorithm (20)

PPTX
Algorithm Complexity and Main Concepts
PDF
Unit 1 OF DS FOR AI DS BTRCH OF DS FOR AI DS BTRCH .pdf
PDF
Data Structures (BE)
PPTX
Chapter one Department Computer Science
PPT
ALGORITHM-ANALYSIS.ppt
PDF
DATA STRUCTURE
PDF
DATA STRUCTURE.pdf
PDF
1-Algorithm Analysijhjhjhjhjhjhjhjhjhjs.pdf
PPTX
III_Data Structure_Module_1.pptx
PPTX
19. Java data structures algorithms and complexity
PPT
Introduction to Data Structures Sorting and searching
PPTX
Mca ii dfs u-1 introduction to data structure
PDF
jn;lm;lkm';m';;lmppt of data structure.pdf
PDF
Iare ds ppt_3
PDF
DATA STRUCTURE AND ALGORITHM FULL NOTES
PPTX
Intro to Data Structure & Algorithms
PPTX
Bsc cs ii dfs u-1 introduction to data structure
PPTX
BCSE202Lkkljkljkbbbnbnghghjghghghghghghghgh
PPTX
19. Data Structures and Algorithm Complexity
Algorithm Complexity and Main Concepts
Unit 1 OF DS FOR AI DS BTRCH OF DS FOR AI DS BTRCH .pdf
Data Structures (BE)
Chapter one Department Computer Science
ALGORITHM-ANALYSIS.ppt
DATA STRUCTURE
DATA STRUCTURE.pdf
1-Algorithm Analysijhjhjhjhjhjhjhjhjhjs.pdf
III_Data Structure_Module_1.pptx
19. Java data structures algorithms and complexity
Introduction to Data Structures Sorting and searching
Mca ii dfs u-1 introduction to data structure
jn;lm;lkm';m';;lmppt of data structure.pdf
Iare ds ppt_3
DATA STRUCTURE AND ALGORITHM FULL NOTES
Intro to Data Structure & Algorithms
Bsc cs ii dfs u-1 introduction to data structure
BCSE202Lkkljkljkbbbnbnghghjghghghghghghghgh
19. Data Structures and Algorithm Complexity

Recently uploaded (20)

PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
ai tools demonstartion for schools and inter college
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
top salesforce developer skills in 2025.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
AI in Product Development-omnex systems
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Migrate SBCGlobal Email to Yahoo Easily
ai tools demonstartion for schools and inter college
Softaken Excel to vCard Converter Software.pdf
top salesforce developer skills in 2025.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
wealthsignaloriginal-com-DS-text-... (1).pdf
Digital Strategies for Manufacturing Companies
Adobe Illustrator 28.6 Crack My Vision of Vector Design
How Creative Agencies Leverage Project Management Software.pdf
AI in Product Development-omnex systems
Design an Analysis of Algorithms I-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
2025 Textile ERP Trends: SAP, Odoo & Oracle
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Reimagine Home Health with the Power of Agentic AI​
Odoo POS Development Services by CandidRoot Solutions
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx

Introduction to datastructure and algorithm

  • 1. Introduction to Data Structure and Algorithm Presented By: Pratik Mota
  • 2. Objectives  Basics of Data Structure and Algorithm  Practical Examples of where Data Structure Algorithms is used  Asymptotic Notations [ O(n), o(n), θ(n), Ω(n), ω(n) ]  Time and Space Complexity  GNU gprof basic
  • 3. Basics of Data structure and Algorithm  Data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.  Some Well-know Data structure 1) Array 2) List [Singly and Doubly Linked List] 3) Tree [ Binary,AVL, Red Black..etc ] 4) B+ Tree 5) Heap [ Max and Min Heap ] 6) Hashing 7) Graph [ BFS, DFS,..etc ]
  • 4. Basics of Data structure and Algorithm Algorithm is a step-by-step procedure for calculations OR you can tell it is sequence of program instructions designed to compute a particular result.  Examples:- Sorting, Searching, Shortest Path, Dynamic Programming, Numerical Algorithms etc.. Sort INPUT sequence of numbers a1, a2, a3,….,an b1,b2,b3,….,bn OUTPUT a permutation of the sequence of numbers 2 5 4 10 7 2 4 5 7 10 Sorting Algorithm
  • 5. Use of Data Structure and Algorithm
  • 8. Asymptotic Notations 1n 2n 3n 4n 5n 6n Runningtime 1 2 3 4 5 6 7 8 9 10 11 12 ….. best-case Ω(n) average-case θ(n) worst-case O(n) Input instance size o(n) ω(n)
  • 9. Basics of Complexity O(1) < O(log n ) < O(n) < O(n log n ) < O(n^2) < ….. < O(n^k) < O(2^n) O( n^2 + n + 1 ) => O(n^2)  MAX ( f(n), g(n) )  O(N + a)^b  O(N^b) Time Complexity :- Amount of time taken by an algorithm to run. Space Complexity:- Extra/Temporary Space use by algorithm .
  • 10. Time and Space Complexity O(n) O(n^2) O( log n )
  • 11. GNU gprof  Gprof is a profiling program which collects performance statistics of our programs.  For Performance analysis -pg option needed for GCC / g++ Compiler. Ex:- g++ -pg gprof_test.cpp -o gprof_test  After running ./gprof_test , It generates gmon.out file.  gmon.out file contain Performance analysis statistics, which can be analyze using gprof tool. Ex:- gprof gprof_test gmon.out > analysis.txt  It provides mainly two type of Performance Analysis 1) Flat Profile [ Total amount of time your program spent executing each function ] 2) Call graph [ How much time was spent in each function and its children ]