Vous êtes sur la page 1sur 13

Course

Year

: T0034 Algorithm Design & Analysis


: 2013

Session 26
Practices of Algorithm Analysis

CASE 1
Create an algorithm to calculate the number of
divisor factor a number N!

Bina Nusantara

STAGE 5
Code optimization
Find which section of the pseudocode that can be
optimized!

Check if all upper and lower bounds were optimal iteration


Check if all the branching conditions are placed correctly
Check if there is redundancy process
Check if there are sections of pseudocode that could be removed
without changing the results
Check if there is any other techniques that can be used

Bina Nusantara

STAGE 6
Writing programs, compiling, testing
Perform repairs if necessary
Issues in choosing a programming language

Bina Nusantara

Issues needed
Speed
Display
Compatibility
Memory and data types

STAGE 7
Implementation, training, maintenance
The last stage is often overlooked
A program mean nothing if users do not know how
to use it!

Bina Nusantara

CASE 2
Make an algorithm to display the number of divider factor of
X, where X is 1 to N!
Example

Number of factor of 1 is a 1
Number of factor of 2 is a 2
Number of factor of 3 is a 2
Number of factor of 4 is a 3
Number of factor of 5 is a 2
Number of factor of 6 is a 4
And so on

It will be displayed: 1, 2, 2, 3, 2, 4, etc.


Bina Nusantara

SOLVING OF CASE 2

Do solution of case 2 with stages such as


case 1!
Is the solution with the flagging technique
can produce a better algorithm?

Bina Nusantara

TRAVELING SALESMAN PROBLEM


In this course, the TSP is used as an example in several
algorithm techniques.
Can the TSP be solved by Divide and Conquer?
Can the TSP be solved by the method Greedy? How did it
go?
How is the TSP solution using Dynamic Programming?
How is the TSP solution using Branch and Bound?
Which one is the best technique to solve the TSP?
Why?
Bina Nusantara

SELECTING ALGORITHM TECHNIQUE


What is the problem that Divide and Conquer is the best
solution?
What is the problem that Greedy Method is the best
solution?
What is the problem that Dynamic Programming is the best
solution?
What is the problem that Backtracking is the best solution?
What is the problem that Branch and Bound technique is
the best solution?
What is the problem that Full Search Tree is the best
solution?

Bina Nusantara

CLOSING
The key to success in mastering computer
programming is practicing and keep practicing.

Bina Nusantara

Books References
References:
Computer Algorithms / C++
Ellis Horowitz, Sartaj Sahni, Sanguthevar Rajasekaran.
Computer Science Press. (1998)

Introduction to Algorithms
Thomas H Cormen, Charles E Leiserson, Ronald L.
3nd Edition. The MIT Press. New York. (2009)

Algoritma Itu Mudah


Robert Setiadi.
PT Prima Infosarana Media, Kelompok Gramedia.
Jakarta. (2008)
Bina Nusantara

END

Bina Nusantara

Vous aimerez peut-être aussi