Basic concepts of data structures and algorithms

RosminaJoyCabauatan 73 views 13 slides Apr 03, 2021
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

Data Structures and Algorithms


Slide Content

Basic Conceptsof
Data Structures and Algorithms
New Wave Analytica
We Find Solutions in Data

Outline
•What is Data Structures?
•Classification of Data Structure According to Type, Elements, Size and Relationship
•Whatisan Abstract Data Type?
•Abstract Data Type Groups
•Algorithm
•Basic Categories of Algorithm
•AlgorithmAnalysis
•Asymptotic analysis
New Wave Analytica

What is Data Structure?
•Incomputerscience,adatastructureisaparticularwayofstoringandorganizing
datainacomputersothatitcanbeusedefficiently.
•DataStructuresaregenerallybasedontheabilityofacomputertofetch(retrieve)
andstoredataatanyplaceinitsmemory,specifiedbyanaddress–abitstringthat
canbeitselfstoredinmemoryandmanipulatedbytheprogram.
New Wave Analytica

Classification of
Data Structure According to Type
•Primitive–these are basic data structures and are directly operated upon machine
instructions, e.g., integer, character.
•Non-primitive–these are derived from primitive data structures, e.g., array.
New Wave Analytica

Classification of
Data Structure According to Elements
•Homogeneous–in this data structure, all elements are of the same type, e.g. array.
•Heterogeneous–in this data structure, elements are of different types, e.g., structure.
New Wave Analytica

Classification of
Data Structure According to Size
•Static–the size of this data structure cannot be changed after the initial allocation, like
matrices.
•Dynamic–the size can change dynamically, like in lists.
New Wave Analytica

Classification of
Data Structure According to Relationship
•Linear–this data structure maintains a linear relationship between its elements, e.g.,
array.
•Non-linear–this data structure does not maintain any linear relationship between its
elements, e.g., in a tree.
New Wave Analytica

What is an Abstract Data Types?
•Itisakeywordofaprogramminglanguagethatspecifiestheamountofmemory
neededtostoredataandthekindofdatathatwillbestoredinthatmemory
location.
•ThenumberofbytesreservedforanADTvaries,dependingontheprogramming
languageusedtowritetheprogramandthetypeofcomputerusedtocompilethe
program.
New Wave Analytica

Abstract Data Type Groups
•Integer
•Floating-point
•Character
•Boolean
New Wave Analytica

Algorithm
•Analgorithmisastep-by-stepprocedure,whichdefinesasetofinstructionstobe
executedinacertainordertogetthedesiredoutput.Algorithmsaregenerallycreated
independentofunderlyinglanguages,i.e.analgorithmcanbeimplementedinmore
thanoneprogramminglanguage.
New Wave Analytica

Basic Categories of Algorithm
•Search− Algorithm to search an item in a data structure.
•Sort− Algorithm to sort items in a certain order.
•Insert− Algorithm to insert an item in a data structure.
•Update− Algorithm to update an existing item in a data structure.
•Delete− Algorithm to delete an existing item from a data structure.
New Wave Analytica

Algorithm Analysis
Theefficiencyofanalgorithmcanbeanalyzedattwodifferentstages,before
implementation,andafterimplementation.Theyarethefollowing
•APrioriAnalysis−ThisisatheoreticalanalysisofanEfficiencyofanalgorithmismeasured
byassumingthatallotherfactors,forexample,processorspeed,areconstantandhaveno
effectontheimplementation.
•APosteriorAnalysis−Thisisanempiricalanalysisofanalgorithm.Theselectedalgorithm
isimplementedusingaprogramminglanguage.ThisisthenexecutedontargetcomputerIn
thisanalysis,actualstatisticslikerunningtimeandspacerequired,arecollected.
New Wave Analytica

Asymptotic Analysis
•Asymptoticanalysisofanalgorithmreferstodefiningthemathematical
foundation/framingofitsrun-timeperformance.Usingasymptoticanalysis,wecanvery
wellconcludethebestcase,averagecase,andworst-casescenarioofanalgorithm.
•Thetimerequiredbyanalgorithmfallsunderthefollowingtypes:
•Best Case− Minimum time required for program
•Average Case− Average time required for program
•Worst Case− Maximum time required for program
New Wave Analytica