top of page

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

WHAT IS ALGORITHM?

Algorithm is collection of steps for solving a problem

For getting output desired about input.

Basic issues related to algorithm

  • How to design algorithm

  • How to express algorithm

  • Proving Correctness

  • Efficiency (time & space)

Too much time/ Too much source is bad algorithm

  • Optimality

Even though no matter how good a program, if this needs a lot of resources, then choose another program.

How good is the algorithm?

  • Correctness

  • Time efficiency = running time

The shorter running time, the better algorithm

  • Space efficiency = memory

The less memory, the better algorithm

Algorithm‘s Requirements

  • Finiteness

algorithm must terminate after running all steps.

  • Definiteness

 Instruction of algorithm, showing the contents and order of operations to perform, needs to explicitly specify.

  • Input

  • Output

 Outputs the result of the value corresponding to the input value.

  • Effectiveness

 All steps are simple and must be feasible.

Why study algorithms?

Theoretical importance

 

Algorithm is core of the computer

Practical importance 

 

possible to design and analyze an algorithm for a new problem, by learning algorithm.

Express algorithms

  • Natural languages

  • Pseudo code

  • Flowcharts

  • Programming language

Pseudo code

Flow chart

Anchor 1
bottom of page