2. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
2
Course Information
Course Name: Algorithm Analysis & Design
Course Code: SE0601
Credit hours: 4
Reference: Jeffrey J. McConnell (2001). Analysis of
Algorithms: An Active Learning Approach. Jones and
Bartlett Publishers, Canada.
Pre-requisites: Programming Fundamentals, Data
Structures and Discreet Mathematics.
The contents of the course is divided into 16 lessons.
Each lesson include presentation, video, quiz, &
discussion.
p
3. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
3
Learning Outcome
By the end of this presentation, students will
be able to:
Understand Algorithms
Understand the design of Algorithms
Understand flow chart & Pseudocode
Understand the properties of Algorithms
Understand the importance of Algorithms
Recognize the types of Algorithms
p
11. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
11
Importance of Algorithm
Algorithm as a Technology
Processing of a large amount of data.
Execution time is very important when
processing a large amount of input.
Algorithms solve the same problem in
different time.
Differences can be much more than
hardware.
p
12. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
12
Efficiency:
Suppose computers were infinitely fast. Would you
have any reason to study algorithm?
Good software engineering practice.
Select the easiest implementation.
New application demand increase in speed.
Time is a non-linear function of the input size.
This can reduce their ability to benefit from the
increase in speed when the input size is large.
p
14. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
14
The execution time of many complex
algorithms can vary due to factors other than
the size of the input.
For example, sorting items that are already
sorted.
p
16. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
16
Types of algorithms
Recursive Algorithms
Backtracking Algorithms
Divide-and-conquer Algorithms
Dynamic Programming Algorithms
Greedy Algorithms
Brute Force Algorithms
p
17. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
17 Summary
In this presentation, we studied Algorithms &
Algorithm design techniques.
The presentation of Algorithm with the flowchart
& pseudocode was explained with examples.
In addition to Algorithm, the properties of
Algorithms, importance of Algorithms & types
of Algorithms were explained
p
18. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
18
Exercises
Write an algorithm in pseudo-code to count the
number of capital letters in a file of text. How
many comparisons does it do? What is the fewest
number of increments it might do? What is the
largest number?
There is a set of numbers stored in a file, but we
don’t know how many it contains. Write an
algorithm in pseudo-code to calculate the average
of the numbers stored in this file. What type of
operations does your algorithm do? How many of
each of these operations does your algorithm do?
p
19. Introduction to Algorithms
Algorithm
Analysis
&
Design March 2020
19
Write an algorithm to find the second largest
element in a list of N values. How many
comparisons does your algorithm do in the worst
case?
1- Write an algorithm and draw a flowchart to
convert the length in feet to centimeter.
2- Write an algorithm and draw a flowchart that will
read the two sides of a rectangle and calculate its
area.
p