Data Structures & Algorithms
Data Structures & Algorithms
& Algorithms
M H B Ariyaratne
Program
A computer program is a
sequence of instructions that
will automate performing a
specific task or solve a given
problem.
Run correctly
Run efficiently
Be easy to modify
Algorithms +
Data
Structures =
Programs
Algorithm “a finite sequence of instructions, each of which has
a clear meaning and can be performed with a finite
Primitive
Character
Integer
Float
Non-primitive
Arrays
Queue
Lists
Stacks
Data Structure Operations
Insert
Delete
Traverse
Search
Sort
Problems sorted with Data
Structures & Algorithms
Real world data storage
Patient
Name
Date of Birth
Age
Weight
Height
Blood Pressure
Programmers tools
Not Real World Data
For the use of the Program Itself
Modeling
Graphs, Plane routes,
Examples - Calculating the BMI
Data Structures
Float for height variable
Float for weight variable
Float for BMI variable
Algorithm
Get height
Get weight
Calculate BMI by weight / (height * height)
Assign calculate value to BMI variable
Print BMI
Thank you