You are on page 1of 28

Algorithmics

CT065-3.5-3

Level 3 Computing (Software Engineering)

Introduction
Welcome to the module
ALGORITHMICS

Module Code and Module Title Title of Slides


Todays Lecture

Overview of Course
Brief Introduction

Module Code and Module Title Title of Slides


Getting Started.

Given a certain problem, how do


you solve it with computer ?

Module Code and Module Title Title of Slides


Getting Started.

Given a certain problem, how do


you solve it with computer ?

design algorithms

Module Code and Module Title Title of Slides


Getting Started.

Given a certain problem, how do


you solve it with computer ?

design algorithms
relatively easy
required cleverness (efficient)

Module Code and Module Title Title of Slides


Design

Designing anything is an art.

Some are creative and cant be taught

But some are involved with


well defined design techniques

Module Code and Module Title Title of Slides


Design

Designing anything is an art.

Some are creative and cant be taught

But some are involved with


well defined design techniques

Goal

Module Code and Module Title Title of Slides


Module Main Goal

At the end of this course you


will be able to solve algorithm
design problem that you may
encounter later in your life
efficiently .

Module Code and Module Title Title of Slides


Pre-requisite

Programming Knowledge
Data Structures
Discrete Mathematics
Our approach is analytical
build mathematical model
design & study properties of algorithm on this model

Module Code and Module Title Title of Slides


Expectations from you

Punctual and regular attendance

Participation with curiosity in class

Enthusiastic involvement in group work

Module Code and Module Title Title of Slides


Available Resources

Consultation hours

Library and Internet Resources

Module Code and Module Title Title of Slides


Recommended Texts
Introduction to Algorithms 3rd Edition by Thomas Cormen,
Charles Leiserson ISBN :9780262533058

Data Structures and Algorithms in Java 3rd Edition, M T


Goodrich, R Tamassia, WILEY 2004, ISBN: 0471-46983-1

Computer Algorithms Introduction to Design & Analysis, S


Baase, A V Gelder, ADDISON, WESLEY 2000, ISBN:
0201612445

Fundamentals of Algorithmics, G Brassard, P Bratley,


PRENTICE-HALL 1996, ISBN:0-13-335068-1

Introduction to Graph Theory 2nd Edition, D B West,


PEARSON HIGHER EDUCATION 2000, ISBN: 0-13-
0144400-2

Module Code and Module Title Title of Slides


Assessment

Exam Paper (100%)


One Section: (5 Questions, 4 Attempted)

Module Code and Module Title Title of Slides


Introduction Algorithm
An algorithm is a sequence of clear instructions
for solving a problem, for obtaining a required
output for any legitimate input in a finite amount
of time
problem

algorithm

input computer output

Module Code and Module Title Title of Slides


15
Algorithms

An algorithm must specify every step completely,


so a computer can implement it without any further
understanding
Algorithms must be:
Correct: For each input, produce an appropriate
output
Efficient: run as quickly as possible, and use as
little memory as possible more about this later
There can be many different algorithms for each
computational problem.

Module Code and Module Title Title of Slides


Computational problems

A computational problem specifies an


input-output relationship
What does the input look like?
What should the output be for each input?
Example:
Input: an integer number N
Output: Is the number prime?
Example:
Input: A list of names of people
Output: The same list sorted alphabetically
Example:
Input: A picture in digital format
Output: An English description of what the picture shows
Module Code and Module Title Title of Slides
Examples
In simple terms, an algorithm is a series of
instructions to solve a problem (complete a task)

Problems can be in any form


Business
Allocate manpower to maximize profit
Life
I am hungry. How do I order pizza?
Explain how to tie shoelaces to a five year old child
--Internet uses clever algorithm that manages huge
volume of data

Module Code and Module Title Title of Slides


Algorithmic Representation of
Computer Functions
Input
Get information Get (input command)
Storage
Store information Given/Result
Intermediates/Set
Process
Arithmetic Set (assignment command)
Repeat instructions Loop
Branch conditionals If
Output
Give information Give (output command)

Module Code and Module Title Title of Slides


Algorithm Description
Understand the problem before solving it
Identify & name each Input/Givens
Identify & name each Output/Results
Assign a name to our algorithm (Name)
Combine the previous 3 pieces of information
into a formal statement (Definition)
Results := Name (Givens)

Module Code and Module Title Title of Slides


Pseudocode
Pseudocode is an artificial and informal
language that helps programmers develop
algorithms.
Pseudocode is a "text-based" detail
(algorithmic) design tool.
The rules of Pseudocode are reasonably
straightforward. All statements showing
"dependency" are to be indented. These
include while, do, for, if, switch

Module Code and Module Title Title of Slides


Pseudocode Example

If student's grade is greater than or equal to 60


Print "passed
else
Print "failed"

Module Code and Module Title Title of Slides


Classification by Data Structures
Linear data structures
lists
arrays
hash tables
stacks
queues

Graph data structures


binary trees
b-trees
heaps

Module Code and Module Title Title of Slides Slide 15 (of 20)
Classification by Design Paradigm

Divide and Conquer


reduction of a problem into its component
parts and solving those parts separately.
Greedy
Makes the best possible decision by choosing
a local optimum at each stage of the
algorithm.
Search and enumeration
Search algorithms and backtracking

Module Code and Module Title Title of Slides Slide 16 (of 20)
Classification by Field of Study

Searching and Sorting


Merging
String matching
Cryptography
Data Compression

Module Code and Module Title Title of Slides Slide 17 (of 20)
A useful video link

http://youtu.be/6hfOvs8pY1k

Module Code and Module Title Title of Slides


Q&A

Any Questions?

Module Code and Module Title Title of Slides


Summary

Introduction to algorithms
Definition of algorithm
Application of algorithms

Module Code and Module Title Title of Slides