Professional Documents
Culture Documents
ALGORITHMS
MO3AZ
What is an algorithm ?
A step-by-step process will be designed to solve the problem.
MO3AZ
SAIF
What is the relationship between data and algorithm ?
The algorithm processes data to make it meaningful, the algorithm provides the
logic, and the data provides the values. this relationship is expressed as:
Program = algorithm + data structures
MO3AZ
SAIF
Algorithm must be ?
Correctness : Returns a correct output for every problem input.
Efficient : The minimal cost of the computational resources used by the algorithm.
Design Analysis
Calculate the cost of the
Design an algorithm at
algorithm in terms of resources
the minimize cost. and performance.
MO3AZ
SAIF
Algorithm Design
What is Flowchart ?
A visual way of representing by diagrams that uses shapes, lines, and arrows to sequence steps.
Start & End Process Input & Output Conditions (IF) Directions
What is Pseudocode ?
A description of the algorithm steps using a mixture of programming languages and English statements.
MO3AZ
SAIF
Algorithm Analysis
What is algorithm efficiency ?
The amount of time and space resources required to execute it.
BIG-O Notation ?
- A mathematical notation that describes the complexity of your code.
Constant Logarithmic Linear Loglinear Polynomial Exponential Factorial
O( 1 ) O( log(n) ) O( n ) O( n log(n) ) O( ) O( ) O( n! )
MO3AZ
SAIF
Recursive Function
What is Recursion ?
A function that calls itself directly or indirectly to solve a problem. It contains two cases:
Base Case ( Solution statement )
General Case ( Recursive function call )
MO3AZ
SAIF
QUESTIONS TIME !
MO3AZ