0% found this document useful (0 votes)
66 views

CSC 305 VTL Lecture 01

This document provides an introduction to the course "Algorithm and Complexity". It discusses key concepts like the definition of an algorithm, types of algorithms, algorithm design methodologies, and theoretical analysis of algorithms. It also lists some recommended reading texts and outlines the introduction to algorithms, including definitions, criteria for algorithms, computational complexity, and the goals of developing efficient algorithms.

Uploaded by

Bello Taiwo
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

CSC 305 VTL Lecture 01

This document provides an introduction to the course "Algorithm and Complexity". It discusses key concepts like the definition of an algorithm, types of algorithms, algorithm design methodologies, and theoretical analysis of algorithms. It also lists some recommended reading texts and outlines the introduction to algorithms, including definitions, criteria for algorithms, computational complexity, and the goals of developing efficient algorithms.

Uploaded by

Bello Taiwo
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Algorithm and Complexity

Course C CSC 305 / CSC 225: / Computer Science

Name Prof. A. S. Sodiya

1
Content
• Introduction to Algorithm and Complexity
• Types of algorithms
• Algorithm design methodologies
• Sorting algorithms
• Theoretical analysis of algorithms
• Order of growth and Asymptotic notations
• Time efficiency of algorithms
• Polynomial order of algorithms
Reading Texts
• Introduction to Algorithms, (The MIT Press) by Thomas H. Cormen,
Charles E. Leiserson, Ronald L. Rivest and Clifford SteinA
• The Algorithm Design Manual by Steven S S. Skiena (Author)
• Algorithm Design by Jon Kleinberg
1.0Introduction to Algorithm
Definitions:
• An algorithm is any well-defined computational procedure that takes some
value, or set of values, as input and produces some value, or set of values,
as output.
• An algorithm is thus a sequence of computational steps that transform the
input into the output.
• An algorithm can also be seen as a computational logic
• We can also view an algorithm as a tool for solving a well-specified
computational problem.
• An algorithm describes a specific computational procedure for achieving
that input/output relationship
An algorithm is a finite set of instructions that, if followed, accomplishes a
particular task.
Introduction to Algorithm….
All algorithms must satisfy the following criteria:
(1) Input. There are zero or more quantities that are externally
supplied.
(2) Output. At least one quantity is produced.
(3) Definiteness. Each instruction is clear and unambiguous.
(4) Finiteness. If we trace out the instructions of an algorithm, then for
all cases, the
algorithm terminates after a finite number of steps.
(5) Effectiveness. Every instruction must be basic enough to be carried
out
Introduction to Algorithm
Computational complexity is the study of the cost of solving interesting problems.
It is the measure of the amount of resources needed in solving problems.
The major resources usually considered are:-
➢Time
➢Space
Algorithm analysis = Analysis of the resources usage of given algorithms
Targets:
❖Make resources usage to be of polynomial order
❖Make that polynomial as small as possible
Avoid:
Exponential order
ie. Polynomial is good, while exponential is bad
Introduction to Algorithm (contd….)
For example, we might need to sort a sequence of numbers in ascending order. This problem
arises frequently in practice and provides fertile ground for introducing many standard design
techniques and analysis tools. Here is how we formally define the sorting problem:

Input: A sequence of n numbers (a1 a2, ….. an)


1

Output: A permutation (reordering) (a’1 a’2, ….. a’n) i of the input sequence such
1

that a’1 ≤ a’2 ≤ ….. a’n 1

For example, given the input sequence {31; 41; 59; 26; 41; 58}, a sorting algorithm
returns as output the sequence {26; 31; 41; 41; 58; 59}. Such an input sequence is
called an instance of the sorting problem. In general, an instance of a problem
consists of the input (satisfying whatever constraints are imposed in the problem
statement) needed to compute a solution to the problem.
Introduction to Algorithm (contd….)
The major goal of this course is to develop techniques for developing efficient algorithms.

Why efficient algorithms?


❖ Efficient algorithms lead to efficient program
❖ Efficient programs sell better
❖ Efficient programs make better use of hardware
❖ Programmers who write efficient programs are more marketable than those who don’t

Factors influencing program efficiency


• Problem being solved
• Programming languages
• Compiler
• Computer hardware
• Programmer ability
• Programmer effectiveness
• Algorithm

You might also like