0% found this document useful (0 votes)
355 views23 pages

COMP6049 - Algorithm Design and Analysis

The document describes a course on algorithm design and analysis. The course aims to teach students fundamental concepts of algorithm analysis including calculating time and space complexity. It will cover algorithm techniques and methods. Students will complete assignments, a midterm, and final exam. They will also participate in programming contests at the university, national, and international level to apply their algorithm skills.

Uploaded by

Uang Keju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
355 views23 pages

COMP6049 - Algorithm Design and Analysis

The document describes a course on algorithm design and analysis. The course aims to teach students fundamental concepts of algorithm analysis including calculating time and space complexity. It will cover algorithm techniques and methods. Students will complete assignments, a midterm, and final exam. They will also participate in programming contests at the university, national, and international level to apply their algorithm skills.

Uploaded by

Uang Keju
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

COMP6049 – Algorithm Design

and Analysis
Topic 1 – Introduction of design and analysis of algorithms
Course Description
• The course (COMP6049 – Algorithm Design
and Analysis) describes fundamental concept
of design and analysis of algorithms in order
to calculate time and space computation,
complexity, and compare design algorithm
methods. It gives the students knowledge of
several algorithm that enable students for
designing a good algorithm.

Bina Nusantara
Learning Outcomes
• LO 1: Explain fundamental concept of analysis
algorithms
• LO 2: Apply algorithm techniques and
methods
• LO 3: Calculate processing time and memory
space of algorithms
• LO 4: Compare several algorithm design
methods

Bina Nusantara
EVALUATION
• Assignment (Individual Assignment +
Participate in INC (Indonesia National
Contest)) : 40%
• Mid Exam : 30%
• Final Exam : 30%

Bina Nusantara
Indonesia National Contest (INC)
• Indonesia National Contest (INC) is programming contest for
students from universities in Indonesia. INC is preparation
contest to participate in International Collegiate
Programming Contest (ICPC).

• Every 3rd semester students majoring computer science


BINUS University MUST participate in this contest (INC).
Participant in this contest will get assignment score in this
course (COMP6049- Algorithm Design & Analysis).

Bina Nusantara
International Collegiate Programming
Contest (ICPC)
• The ACM International Collegiate Programming Contest (ICPC) is a
multitier, team-based, programming competition operating under
the auspices of ACM and headquartered at Baylor University. The
contest involves a global network of universities hosting regional
competitions that advance teams to the ACM-ICPC World Finals.
Participation has grown to several tens of thousands of the finest
students and faculty in computing disciplines at almost 2,000
universities from over 80 countries on six continents. The contest
fosters creativity, teamwork, and innovation in building new
software programs, and enables students to test their ability to
perform under pressure. Quite simply, it is the oldest, largest, and
most prestigious programming contest in the world.

• The contest will cover problem solving algorithm. Teams will be


presented with set of problems that should be solved to meet the
judges. solutions using C/C++/Java programming language.

Bina Nusantara
INFORMATION & REGISTRATION (INC/ICPC)

• More information about INC/ICPC can be accessed in


this link :
http://competition.binus.ac.id/portal/
• For REGISTRATION GUIDELINE can be downloaded in
Binusmaya (Message Section).
• For exercise can be accessed in this link:
http://pandaoj.com or https://open.kattis.com/

Bina Nusantara
Outline Materials
 Definition of algorithms
 Definition of pseudocode
 Introduction to analysis of algorithms

Bina Nusantara University ISYS6197 8


WHAT IS AN ALGORITHM?

• The word algorithm comes from the name of a


Persian author, Abu Ja’far Mohammed ibn Musa
al Khowarizmi (c. 824 A.D.)
• An algorithm is a sequence of computational
steps that transform the input into the output.
• An algorithm is a tool for solving a well-
specified computational problem.
• An algorithm is computable and measurable.
• An algorithm is a finite set of instructions that, if
followed, accomplishes a particular task.

Bina Nusantara
CRITERIA OF ALGORITHMS

• All algorithms must satisfy the following criteria:


– Input: zero or more quantities are externally supplied.
– Output: at least one quantity produced.
– Definiteness: Each instruction is clear and
unambiguous.
– Finiteness: if we trace out the instructions of an
algorithm, then for all cases the algorithm terminates
after a finite number of steps.
– Effectiveness: every instruction must be very so that it
can be carry out by a person only by pencil and paper.

Bina Nusantara
WHAT IS A PROGRAM?
• A program is the expression of an algorithm in a
programming language.
• Sometimes such as procedure, function, and
subroutine are used synonymously for program.
4 DISTINCT AREAS STUDY OF
ALGORITHMS
• How to devise algorithms
• How to validate algorithms
• How to analyze algorithms
• How to test a program

Bina Nusantara
PSEUDOCODE
• Pseudocode is one of methods to write high-level
specification of an algorithm.
• It is usually written in combination of English and
mathematic notations.

Bina Nusantara
PSEUDOCODE EXAMPLE (1)

• Algorithm for Selection Sort


for (i=1;i<=n;i++){
examine a[i] to a[n] and suppose
the smallest element at a[j];
interchange a[i] and a[j];
}

• Solving problem of Algorithm


interchange a[i] and a[j]
t=a[i]; a[i]=a[j]; a[j]=t;

Bina Nusantara
PSEUDOCODE EXAMPLE (2)

• Algorithm for calculating N factorial


t=1
for (i=1;i<=n;i++){
t=t*i
}
print ”Factorial of ”,N,” is ”,t

Bina Nusantara
COMPONENTS OF PSEUDOCODE

• Variable
• Iterative (loop)
– for-do technique
– repeat-until technique
– while-do technique
• Selection (branch)
– if-then technique
– select-case technique
• Module
– Procedure / Sub
– Function
– Recursive technique

Bina Nusantara
MATHEMATICAL NOTATIONS

Summation and its properties:


n

1. a1  a2  ....  an   ak
k 1
n n n
2. Linearity  c a
k 1
k  bk   c  ak   bk
k 1 k 1

3. n
 n 
   f k      f k 
k 1  k 1 

Bina Nusantara
SERIES

1. Arithmetic series
n
n n  1
 k  1  2  .....  n 
2
  
n 2

k 1

2. Harmonic series

H n  1  12  13  14  .....  1n
n
 1
k  ln n  0 1
k 1

Bina Nusantara
EXERCISE
1. Write a C++ program that searches an unsorted
array a[0:n-1] for the element x. If x exists in the
array then return a position in the array, else
return -1. 
2. The factorial function n! has value 1 when n 1
and vaue n*(n-1)! When n>1. Write both a
recursive and an iterative C++ program to
compute n!.
3. Consider the function F(x) defined by “if x is even
then F(x)=x/2; else F(x)=F(F(3x+1)).” Prove that F(x)
terminates all integer x.
REVIEW

• What is algorithm?
• Criteria of algorithms
• What is a program?
• 4 distinct areas study of algorithms
• Pseudocode
• Mathematic notation
• Arithmetic and harmonic series

Bina Nusantara
Q&A
References
• S. Sridhar. 2015. Design and Analysis of Algorithms, 1/e.
Oxford University Press. India. Chapter 1
• Thomas H. Cormen. (2009). Introduction to algorithms.03.
The MIT Press.
• Some Introductionary Notes on Design and Analysis of
Algorithms
http:// www.imsc.res.in/~vraman/pub/intro_notes.pdf
THANK YOU

You might also like