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

PPT
Depth First Search ( DFS )
PPTX
Dfs presentation
PPT
Graph traversal-BFS & DFS
PPTX
DFS and BFS
PPT
Binary search tree(bst)
PPTX
Bfs and Dfs
PPTX
DFS & BFS Graph
PPTX
B+ tree intro,uses,insertion and deletion
Depth First Search ( DFS )
Dfs presentation
Graph traversal-BFS & DFS
DFS and BFS
Binary search tree(bst)
Bfs and Dfs
DFS & BFS Graph
B+ tree intro,uses,insertion and deletion

What's hot (20)

PPTX
Data structures and algorithms
PPT
Divide and conquer
PPT
Unit 1 introduction to data structure
PPTX
Depth-First Search
PPT
Breadth first search and depth first search
PDF
Trees, Binary Search Tree, AVL Tree in Data Structures
PPTX
Abstract Data Types
PPT
Map reduce in BIG DATA
PPT
Bfs and dfs in data structure
PDF
Binary tree
PPT
Indexing and Hashing
PPT
SINGLE-SOURCE SHORTEST PATHS
PPTX
PPT
Binary tree traversal ppt - 02.03.2020
PDF
Expression trees
PPT
PDF
PPTX
Red black trees
PPTX
Hashing Technique In Data Structures
PPTX
Binomial heap presentation
Data structures and algorithms
Divide and conquer
Unit 1 introduction to data structure
Depth-First Search
Breadth first search and depth first search
Trees, Binary Search Tree, AVL Tree in Data Structures
Abstract Data Types
Map reduce in BIG DATA
Bfs and dfs in data structure
Binary tree
Indexing and Hashing
SINGLE-SOURCE SHORTEST PATHS
Binary tree traversal ppt - 02.03.2020
Expression trees
Red black trees
Hashing Technique In Data Structures
Binomial heap presentation
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)

PPT
19 algorithms-and-complexity-110627100203-phpapp02
PPT
Basics of data structure types of data structures
PPT
Stack squeues lists
PPT
Stacks queues lists
PPT
Stacks queues lists
PPT
Stacksqueueslists
PPT
Stacks queues lists
PPT
Stacks queues lists
PPTX
19. Data Structures and Algorithm Complexity
PPTX
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
PPT
lecture1.ppt
PPT
C++ Notes PPT.ppt
PPT
Profiling and optimization
PPT
Analysis of Algorithum
PDF
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
PPTX
19. algorithms and-complexity
PPT
Introduction to Algorithms
PDF
Annotations.pdf
PPT
Lec7.ppt
19 algorithms-and-complexity-110627100203-phpapp02
Basics of data structure types of data structures
Stack squeues lists
Stacks queues lists
Stacks queues lists
Stacksqueueslists
Stacks queues lists
Stacks queues lists
19. Data Structures and Algorithm Complexity
Data Structures and Agorithm: DS 22 Analysis of Algorithm.pptx
lecture1.ppt
C++ Notes PPT.ppt
Profiling and optimization
Analysis of Algorithum
Data Structures and Algorithms Lecture 2: Analysis of Algorithms, Asymptotic ...
19. algorithms and-complexity
Introduction to Algorithms
Annotations.pdf
Lec7.ppt

Recently uploaded (20)

PDF
Guide to Food Delivery App Development.pdf
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Website Design Services for Small Businesses.pdf
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PPTX
Computer Software - Technology and Livelihood Education
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
E-Commerce Website Development Companyin india
Guide to Food Delivery App Development.pdf
Tech Workshop Escape Room Tech Workshop
Visual explanation of Dijkstra's Algorithm using Python
Wondershare Recoverit Full Crack New Version (Latest 2025)
CNN LeNet5 Architecture: Neural Networks
DNT Brochure 2025 – ISV Solutions @ D365
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
Autodesk AutoCAD Crack Free Download 2025
Website Design Services for Small Businesses.pdf
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
"Secure File Sharing Solutions on AWS".pptx
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
Computer Software - Technology and Livelihood Education
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
E-Commerce Website Development Companyin india

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 ]