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

What's hot (20)

PPT
Data Structure and Algorithms
ManishPrajapati78
 
PPT
Data Structures and Algorithm Analysis
Mary Margarat
 
PPTX
Knuth morris pratt string matching algo
sabiya sabiya
 
PPTX
Uninformed Search technique
Kapil Dahal
 
DOCX
Object Oriented Analysis and Design one marks Q & A
eeducations ever
 
PPT
Greedy method1
Rajendran
 
PDF
Compiler Design Introduction
Kuppusamy P
 
PPTX
Big o notation
hamza mushtaq
 
ODP
Job scheduling
Sanjay Singh
 
PDF
Lab report for Prolog program in artificial intelligence.
Alamgir Hossain
 
PPTX
Looping Statements and Control Statements in Python
PriyankaC44
 
PPTX
System call
DarakhshanNayyab
 
PPTX
Artificial Intelligence Notes Unit 4
DigiGurukul
 
PPTX
Graph coloring using backtracking
shashidharPapishetty
 
PPT
Branch and bound
Dr Shashikant Athawale
 
PPT
Sum of subsets problem by backtracking 
Hasanain Alshadoodee
 
PPT
pseudo code basics
Sabik T S
 
PPTX
Graph Algorithms: Breadth-First Search (BFS)
Md. Shafiuzzaman Hira
 
PPTX
Programming Fundamentals lecture 1
REHAN IJAZ
 
PDF
Fundamentals of data structures ellis horowitz & sartaj sahni
Hitesh Wagle
 
Data Structure and Algorithms
ManishPrajapati78
 
Data Structures and Algorithm Analysis
Mary Margarat
 
Knuth morris pratt string matching algo
sabiya sabiya
 
Uninformed Search technique
Kapil Dahal
 
Object Oriented Analysis and Design one marks Q & A
eeducations ever
 
Greedy method1
Rajendran
 
Compiler Design Introduction
Kuppusamy P
 
Big o notation
hamza mushtaq
 
Job scheduling
Sanjay Singh
 
Lab report for Prolog program in artificial intelligence.
Alamgir Hossain
 
Looping Statements and Control Statements in Python
PriyankaC44
 
System call
DarakhshanNayyab
 
Artificial Intelligence Notes Unit 4
DigiGurukul
 
Graph coloring using backtracking
shashidharPapishetty
 
Branch and bound
Dr Shashikant Athawale
 
Sum of subsets problem by backtracking 
Hasanain Alshadoodee
 
pseudo code basics
Sabik T S
 
Graph Algorithms: Breadth-First Search (BFS)
Md. Shafiuzzaman Hira
 
Programming Fundamentals lecture 1
REHAN IJAZ
 
Fundamentals of data structures ellis horowitz & sartaj sahni
Hitesh Wagle
 

Viewers also liked (7)

PPTX
Major Types of Research
Tabi Khan
 
PPT
Introduction to data structures and Algorithm
Dhaval Kaneria
 
PPTX
Types of research
Ashish Sahu
 
PPSX
Types of Research Designs RS Mehta
BP KOIRALA INSTITUTE OF HELATH SCIENCS,, NEPAL
 
PPT
Definition and types of research
fadifm
 
Major Types of Research
Tabi Khan
 
Introduction to data structures and Algorithm
Dhaval Kaneria
 
Types of research
Ashish Sahu
 
Types of Research Designs RS Mehta
BP KOIRALA INSTITUTE OF HELATH SCIENCS,, NEPAL
 
Definition and types of research
fadifm
 
Ad

Similar to Introduction to datastructure and algorithm (20)

PPTX
Algorithm Complexity and Main Concepts
Adelina Ahadova
 
PDF
Unit 1 OF DS FOR AI DS BTRCH OF DS FOR AI DS BTRCH .pdf
prathamsingh33
 
PDF
Data Structures (BE)
PRABHAHARAN429
 
PPTX
Chapter one Department Computer Science
demissieejo
 
PPT
ALGORITHM-ANALYSIS.ppt
sapnaverma97
 
PDF
DATA STRUCTURE
RobinRohit2
 
PDF
DATA STRUCTURE.pdf
ibrahim386946
 
PDF
1-Algorithm Analysijhjhjhjhjhjhjhjhjhjs.pdf
NGUYNTHNHQUC2
 
PPTX
III_Data Structure_Module_1.pptx
shashankbhadouria4
 
PPTX
19. Java data structures algorithms and complexity
Intro C# Book
 
PPT
Introduction to Data Structures Sorting and searching
Mvenkatarao
 
PPTX
Mca ii dfs u-1 introduction to data structure
Rai University
 
PDF
jn;lm;lkm';m';;lmppt of data structure.pdf
VinayNassa3
 
PDF
Iare ds ppt_3
AlugatiRajitha
 
PDF
DATA STRUCTURE AND ALGORITHM FULL NOTES
Aniruddha Paul
 
PPTX
Intro to Data Structure & Algorithms
Akhil Kaushik
 
PPTX
Bsc cs ii dfs u-1 introduction to data structure
Rai University
 
PPTX
BCSE202Lkkljkljkbbbnbnghghjghghghghghghghgh
shivapatil54
 
PPTX
19. Data Structures and Algorithm Complexity
Intro C# Book
 
Algorithm Complexity and Main Concepts
Adelina Ahadova
 
Unit 1 OF DS FOR AI DS BTRCH OF DS FOR AI DS BTRCH .pdf
prathamsingh33
 
Data Structures (BE)
PRABHAHARAN429
 
Chapter one Department Computer Science
demissieejo
 
ALGORITHM-ANALYSIS.ppt
sapnaverma97
 
DATA STRUCTURE
RobinRohit2
 
DATA STRUCTURE.pdf
ibrahim386946
 
1-Algorithm Analysijhjhjhjhjhjhjhjhjhjs.pdf
NGUYNTHNHQUC2
 
III_Data Structure_Module_1.pptx
shashankbhadouria4
 
19. Java data structures algorithms and complexity
Intro C# Book
 
Introduction to Data Structures Sorting and searching
Mvenkatarao
 
Mca ii dfs u-1 introduction to data structure
Rai University
 
jn;lm;lkm';m';;lmppt of data structure.pdf
VinayNassa3
 
Iare ds ppt_3
AlugatiRajitha
 
DATA STRUCTURE AND ALGORITHM FULL NOTES
Aniruddha Paul
 
Intro to Data Structure & Algorithms
Akhil Kaushik
 
Bsc cs ii dfs u-1 introduction to data structure
Rai University
 
BCSE202Lkkljkljkbbbnbnghghjghghghghghghghgh
shivapatil54
 
19. Data Structures and Algorithm Complexity
Intro C# Book
 
Ad

Recently uploaded (20)

PDF
System Center 2025 vs. 2022; What’s new, what’s next_PDF.pdf
Q-Advise
 
PDF
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PDF
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
System Center 2025 vs. 2022; What’s new, what’s next_PDF.pdf
Q-Advise
 
How Agentic AI Networks are Revolutionizing Collaborative AI Ecosystems in 2025
ronakdubey419
 
Brief History of Python by Learning Python in three hours
adanechb21
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Activate_Methodology_Summary presentatio
annapureddyn
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
Role Of Python In Programing Language.pptx
jaykoshti048
 

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 ]