2.0 Introduction To Data Structures and Algorithms
2.0 Introduction To Data Structures and Algorithms
programming effort.
Bubble sort
Selection sort
Shellsort
Mergesort
Others
Properties of algorithms:
It must be correct.
It must be composed of a series of concrete
steps.
There can be no ambiguity as to which step
will be performed next.
It must be composed of a finite number of
steps.
It must terminate.
.
data structures & algorithms 28
Programs
A computer program is a concrete
representation of an algorithm in some
programming language.
Naturally, there are many programs that
are instances of the same algorithms, since
any modern programming language can be
used to implement any algorithm.
calcSum (integer n)
Sum 0
for i 1 to n
sum sum + i
return sum