SlideShare a Scribd company logo
1 of 27
Introduction
to
Data Structure & Algorithm
by:
Dr. Shweta Saraswat
Contents
• Introduction
• What is data structure?
• What is an Algorithm?
• Qualities of good algorithm
• Data structures and types
• Why data structures?
Introduction
• Programming is all about data structures and
algorithms. Data structures are used to hold
data while algorithms are used to solve the
problem using that data.
• Data structures and algorithms (DSA) goes
through solutions to standard problems in
detail and gives you an insight into how
efficient it is to use each one of them. It also
teaches you the science of evaluating the
efficiency of an algorithm. This enables you to
choose the best of various choices.
What is Data Structure?
• A data structure is a storage that is used to
store and organize data. It is a way of
arranging data on a computer so that it can
be accessed and updated efficiently.
What is an algorithm?
• In computer programming terms, an
algorithm is a set of well-defined instructions
to solve a particular problem. It takes a set of
input(s) and produces the desired output. For
example,
• An algorithm to add two numbers:
1. Take two number inputs
2. Add numbers using the + operator
3. Display the result
Qualities of a Good Algorithm
• Input and output should be defined precisely.
• Each step in the algorithm should be clear
and unambiguous.
• Algorithms should be most effective among
many different ways to solve a problem.
• An algorithm shouldn't include computer
code. Instead, the algorithm should be written
in such a way that it can be used in different
programming languages.
Example:
Algorithm 1: Add two numbers entered by
the user
• Step 1: Start
• Step 2: Declare variables num1, num2 and
sum.
• Step 3: Read values num1 and num2.
• Step 4: Add num1 and num2 and assign the
result to sum. sum←num1+num2
• Step 5: Display sum
• Step 6: Stop
What are Data Structures?
• Data structure is a storage that is used to
store and organize data. It is a way of
arranging data on a computer so that it can
be accessed and updated efficiently.
• Depending on your requirement and project,
it is important to choose the right data
structure for your project. For example, if you
want to store data sequentially in the
memory, then you can go for the Array data
structure.
Array Data structure
Representation
Note: Data structure and data types are slightly
different. Data structure is the collection of
data types arranged in a specific order.
Types of Data Structure
• Basically, data structures are divided into two
categories:
• Linear data structure
• Non-linear data structure
Linear data structures
• In linear data structures, the elements are
arranged in sequence one after the other.
Since elements are arranged in particular
order, they are easy to implement.
• However, when the complexity of the
program increases, the linear data structures
might not be the best choice because of
operational complexities.
Popular linear data structures are:
1. Array Data Structure
2. Stack Data Structure
3. Queue Data Structure
4. Linked List Data Structure
1. Array Data Structure
are:
In an array, elements in memory are arranged in
continuous memory. All the elements of an
array are of the same type. And, the type of
elements that can be stored in the form of
arrays is determined by the programming
language.
2. Stack Data Structure
• In stack data structure, elements are stored in
the LIFO principle. That is, the last element
stored in a stack will be removed first.
3. Queue Data Structure
• Unlike stack, the queue data structure works
in the FIFO principle where first element
stored in the queue will be removed first.
• It works just like a queue of people in the
ticket counter where first person on the
queue will get the ticket first.
4. Linked List Data Structure
• In linked list data structure, data elements are
connected through a series of nodes. And,
each node contains the data items and
address to the next node.
4. Linked List Data Structure
• In linked list data structure, data elements are
connected through a series of nodes. And,
each node contains the data items and
address to the next node.
Non linear data structures
• Unlike linear data structures, elements in non-
linear data structures are not in any sequence.
Instead they are arranged in a hierarchical
manner where one element will be connected
to one or more elements.
• Non-linear data structures are further divided
into graph and tree based data structures.
• 1. Graph Data Structure
• 2. Trees Data Structure
1. Graph Data Structure
• In graph data structure, each node is called
vertex and each vertex is connected to other
vertices through edges.
Popular Graph Based Data
Structures:
• Spanning Tree and Minimum Spanning Tree
• Strongly Connected Components
• Adjacency Matrix
• Adjacency List
2. Trees Data Structure
• Similar to a graph, a tree is also a collection of
vertices and edges. However, in tree data
structure, there can only be one edge
between two vertices.
2. Trees Data Structure
• Similar to a graph, a tree is also a collection of
vertices and edges. However, in tree data
structure, there can only be one edge
between two vertices.
2. Popular Tree based Data
Structure
• Binary Tree
• Binary Search Tree
• AVL Tree
• B-Tree
• B+ Tree
• Red-Black Tree
Linear Vs Non-linear Data
Structures
Why Data Structure?
• Knowledge about data structures help you
understand the working of each data
structure. And, based on that you can select
the right data structures for your project.
• This helps you write memory and time
efficient code.
Conclusion

More Related Content

Similar to dsa.pptx

b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptxclassall
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.pptclassall
 
Data structures lectures no 1
Data structures lectures no 1Data structures lectures no 1
Data structures lectures no 1AzharIqbal710687
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptxclassall
 
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
 
1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptx1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptxRahikAhmed
 
DATA-STRUCTURES.pptx
DATA-STRUCTURES.pptxDATA-STRUCTURES.pptx
DATA-STRUCTURES.pptxRuchiNagar3
 
PPT Format prashant .pptx
PPT Format prashant .pptxPPT Format prashant .pptx
PPT Format prashant .pptxSafdarAli435862
 
Algorithms and Data Structures
Algorithms and Data StructuresAlgorithms and Data Structures
Algorithms and Data Structuressonykhan3
 
Introduction to DS.pptx
Introduction to DS.pptxIntroduction to DS.pptx
Introduction to DS.pptxOnkarModhave
 
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEMM. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEMDr.Florence Dayana
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfMAJDABDALLAH3
 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechniclavparmar007
 
Data Structure & Algorithm.pptx
Data Structure & Algorithm.pptxData Structure & Algorithm.pptx
Data Structure & Algorithm.pptxMumtaz
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm. Abdul salam
 

Similar to dsa.pptx (20)

Data structures
Data structuresData structures
Data structures
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.ppt
 
Data structures lectures no 1
Data structures lectures no 1Data structures lectures no 1
Data structures lectures no 1
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 
Data structure
Data  structureData  structure
Data structure
 
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
 
1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptx1. Introduction to Data Structure.pptx
1. Introduction to Data Structure.pptx
 
DATA-STRUCTURES.pptx
DATA-STRUCTURES.pptxDATA-STRUCTURES.pptx
DATA-STRUCTURES.pptx
 
PPT Format prashant .pptx
PPT Format prashant .pptxPPT Format prashant .pptx
PPT Format prashant .pptx
 
Algorithms and Data Structures
Algorithms and Data StructuresAlgorithms and Data Structures
Algorithms and Data Structures
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Introduction to DS.pptx
Introduction to DS.pptxIntroduction to DS.pptx
Introduction to DS.pptx
 
ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
 
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEMM. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
M. FLORENCE DAYANA/DATABASE MANAGEMENT SYSYTEM
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
 
Data Structure # vpmp polytechnic
Data Structure # vpmp polytechnicData Structure # vpmp polytechnic
Data Structure # vpmp polytechnic
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
Data Structure & Algorithm.pptx
Data Structure & Algorithm.pptxData Structure & Algorithm.pptx
Data Structure & Algorithm.pptx
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
 

More from Dr.Shweta

research ethics , plagiarism checking and removal.pptx
research ethics , plagiarism checking and removal.pptxresearch ethics , plagiarism checking and removal.pptx
research ethics , plagiarism checking and removal.pptxDr.Shweta
 
effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptxDr.Shweta
 
software design: design fundamentals.pptx
software design: design fundamentals.pptxsoftware design: design fundamentals.pptx
software design: design fundamentals.pptxDr.Shweta
 
Search Algorithms in AI.pptx
Search Algorithms in AI.pptxSearch Algorithms in AI.pptx
Search Algorithms in AI.pptxDr.Shweta
 
Informed search algorithms.pptx
Informed search algorithms.pptxInformed search algorithms.pptx
Informed search algorithms.pptxDr.Shweta
 
constraint satisfaction problems.pptx
constraint satisfaction problems.pptxconstraint satisfaction problems.pptx
constraint satisfaction problems.pptxDr.Shweta
 
review paper publication.pptx
review paper publication.pptxreview paper publication.pptx
review paper publication.pptxDr.Shweta
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptxDr.Shweta
 
Recommended System.pptx
 Recommended System.pptx Recommended System.pptx
Recommended System.pptxDr.Shweta
 
semi supervised Learning and Reinforcement learning (1).pptx
 semi supervised Learning and Reinforcement learning (1).pptx semi supervised Learning and Reinforcement learning (1).pptx
semi supervised Learning and Reinforcement learning (1).pptxDr.Shweta
 
introduction to Statistical Theory.pptx
 introduction to Statistical Theory.pptx introduction to Statistical Theory.pptx
introduction to Statistical Theory.pptxDr.Shweta
 
Unit 2 unsupervised learning.pptx
Unit 2 unsupervised learning.pptxUnit 2 unsupervised learning.pptx
Unit 2 unsupervised learning.pptxDr.Shweta
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxDr.Shweta
 
Introduction of machine learning.pptx
Introduction of machine learning.pptxIntroduction of machine learning.pptx
Introduction of machine learning.pptxDr.Shweta
 
searching techniques.pptx
searching techniques.pptxsearching techniques.pptx
searching techniques.pptxDr.Shweta
 
LINKED LIST.pptx
LINKED LIST.pptxLINKED LIST.pptx
LINKED LIST.pptxDr.Shweta
 
complexity.pptx
complexity.pptxcomplexity.pptx
complexity.pptxDr.Shweta
 
Introduction to Data Science.pptx
Introduction to Data Science.pptxIntroduction to Data Science.pptx
Introduction to Data Science.pptxDr.Shweta
 

More from Dr.Shweta (20)

research ethics , plagiarism checking and removal.pptx
research ethics , plagiarism checking and removal.pptxresearch ethics , plagiarism checking and removal.pptx
research ethics , plagiarism checking and removal.pptx
 
effective modular design.pptx
effective modular design.pptxeffective modular design.pptx
effective modular design.pptx
 
software design: design fundamentals.pptx
software design: design fundamentals.pptxsoftware design: design fundamentals.pptx
software design: design fundamentals.pptx
 
Search Algorithms in AI.pptx
Search Algorithms in AI.pptxSearch Algorithms in AI.pptx
Search Algorithms in AI.pptx
 
Informed search algorithms.pptx
Informed search algorithms.pptxInformed search algorithms.pptx
Informed search algorithms.pptx
 
constraint satisfaction problems.pptx
constraint satisfaction problems.pptxconstraint satisfaction problems.pptx
constraint satisfaction problems.pptx
 
review paper publication.pptx
review paper publication.pptxreview paper publication.pptx
review paper publication.pptx
 
SORTING techniques.pptx
SORTING techniques.pptxSORTING techniques.pptx
SORTING techniques.pptx
 
Recommended System.pptx
 Recommended System.pptx Recommended System.pptx
Recommended System.pptx
 
semi supervised Learning and Reinforcement learning (1).pptx
 semi supervised Learning and Reinforcement learning (1).pptx semi supervised Learning and Reinforcement learning (1).pptx
semi supervised Learning and Reinforcement learning (1).pptx
 
introduction to Statistical Theory.pptx
 introduction to Statistical Theory.pptx introduction to Statistical Theory.pptx
introduction to Statistical Theory.pptx
 
Unit 2 unsupervised learning.pptx
Unit 2 unsupervised learning.pptxUnit 2 unsupervised learning.pptx
Unit 2 unsupervised learning.pptx
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptx
 
Introduction of machine learning.pptx
Introduction of machine learning.pptxIntroduction of machine learning.pptx
Introduction of machine learning.pptx
 
searching techniques.pptx
searching techniques.pptxsearching techniques.pptx
searching techniques.pptx
 
LINKED LIST.pptx
LINKED LIST.pptxLINKED LIST.pptx
LINKED LIST.pptx
 
complexity.pptx
complexity.pptxcomplexity.pptx
complexity.pptx
 
queue.pptx
queue.pptxqueue.pptx
queue.pptx
 
STACK.pptx
STACK.pptxSTACK.pptx
STACK.pptx
 
Introduction to Data Science.pptx
Introduction to Data Science.pptxIntroduction to Data Science.pptx
Introduction to Data Science.pptx
 

Recently uploaded

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiSuhani Kapoor
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiSuhani Kapoor
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxolyaivanovalion
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystSamantha Rae Coolbeth
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxolyaivanovalion
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 

Recently uploaded (20)

Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service BhilaiLow Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
Low Rate Call Girls Bhilai Anika 8250192130 Independent Escort Service Bhilai
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service AmravatiVIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
VIP Call Girls in Amravati Aarohi 8250192130 Independent Escort Service Amravati
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Ravak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptxRavak dropshipping via API with DroFx.pptx
Ravak dropshipping via API with DroFx.pptx
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Unveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data AnalystUnveiling Insights: The Role of a Data Analyst
Unveiling Insights: The Role of a Data Analyst
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 

dsa.pptx

  • 1. Introduction to Data Structure & Algorithm by: Dr. Shweta Saraswat
  • 2. Contents • Introduction • What is data structure? • What is an Algorithm? • Qualities of good algorithm • Data structures and types • Why data structures?
  • 3. Introduction • Programming is all about data structures and algorithms. Data structures are used to hold data while algorithms are used to solve the problem using that data. • Data structures and algorithms (DSA) goes through solutions to standard problems in detail and gives you an insight into how efficient it is to use each one of them. It also teaches you the science of evaluating the efficiency of an algorithm. This enables you to choose the best of various choices.
  • 4. What is Data Structure? • A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently.
  • 5. What is an algorithm? • In computer programming terms, an algorithm is a set of well-defined instructions to solve a particular problem. It takes a set of input(s) and produces the desired output. For example, • An algorithm to add two numbers: 1. Take two number inputs 2. Add numbers using the + operator 3. Display the result
  • 6. Qualities of a Good Algorithm • Input and output should be defined precisely. • Each step in the algorithm should be clear and unambiguous. • Algorithms should be most effective among many different ways to solve a problem. • An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.
  • 7. Example: Algorithm 1: Add two numbers entered by the user • Step 1: Start • Step 2: Declare variables num1, num2 and sum. • Step 3: Read values num1 and num2. • Step 4: Add num1 and num2 and assign the result to sum. sum←num1+num2 • Step 5: Display sum • Step 6: Stop
  • 8. What are Data Structures? • Data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accessed and updated efficiently. • Depending on your requirement and project, it is important to choose the right data structure for your project. For example, if you want to store data sequentially in the memory, then you can go for the Array data structure.
  • 10. Note: Data structure and data types are slightly different. Data structure is the collection of data types arranged in a specific order.
  • 11. Types of Data Structure • Basically, data structures are divided into two categories: • Linear data structure • Non-linear data structure
  • 12. Linear data structures • In linear data structures, the elements are arranged in sequence one after the other. Since elements are arranged in particular order, they are easy to implement. • However, when the complexity of the program increases, the linear data structures might not be the best choice because of operational complexities.
  • 13. Popular linear data structures are: 1. Array Data Structure 2. Stack Data Structure 3. Queue Data Structure 4. Linked List Data Structure
  • 14. 1. Array Data Structure are: In an array, elements in memory are arranged in continuous memory. All the elements of an array are of the same type. And, the type of elements that can be stored in the form of arrays is determined by the programming language.
  • 15. 2. Stack Data Structure • In stack data structure, elements are stored in the LIFO principle. That is, the last element stored in a stack will be removed first.
  • 16. 3. Queue Data Structure • Unlike stack, the queue data structure works in the FIFO principle where first element stored in the queue will be removed first. • It works just like a queue of people in the ticket counter where first person on the queue will get the ticket first.
  • 17. 4. Linked List Data Structure • In linked list data structure, data elements are connected through a series of nodes. And, each node contains the data items and address to the next node.
  • 18. 4. Linked List Data Structure • In linked list data structure, data elements are connected through a series of nodes. And, each node contains the data items and address to the next node.
  • 19. Non linear data structures • Unlike linear data structures, elements in non- linear data structures are not in any sequence. Instead they are arranged in a hierarchical manner where one element will be connected to one or more elements. • Non-linear data structures are further divided into graph and tree based data structures. • 1. Graph Data Structure • 2. Trees Data Structure
  • 20. 1. Graph Data Structure • In graph data structure, each node is called vertex and each vertex is connected to other vertices through edges.
  • 21. Popular Graph Based Data Structures: • Spanning Tree and Minimum Spanning Tree • Strongly Connected Components • Adjacency Matrix • Adjacency List
  • 22. 2. Trees Data Structure • Similar to a graph, a tree is also a collection of vertices and edges. However, in tree data structure, there can only be one edge between two vertices.
  • 23. 2. Trees Data Structure • Similar to a graph, a tree is also a collection of vertices and edges. However, in tree data structure, there can only be one edge between two vertices.
  • 24. 2. Popular Tree based Data Structure • Binary Tree • Binary Search Tree • AVL Tree • B-Tree • B+ Tree • Red-Black Tree
  • 25. Linear Vs Non-linear Data Structures
  • 26. Why Data Structure? • Knowledge about data structures help you understand the working of each data structure. And, based on that you can select the right data structures for your project. • This helps you write memory and time efficient code.