Advance Theory and Design of Algorithm: Lecture 1: Overview
Advance Theory and Design of Algorithm: Lecture 1: Overview
Lecture 1: Overview
Instructor: Aqib Perwaiz
ABASYN UNIVERSITY
Outline
2
¨ Course Administration
¨ Grading Policy
Number Activities/ Evaluation Methods Percentages
¨ The Honor Code applies to your conduct in this course. If you have
questions, talk to me
¨ HOMEWORK:
¤ All submitted work must be your own
¤ Do not copy another student’s work
¤ Do discuss material and homework with classmates, professor
¤ If you work with someone, write this on the first page of your
submitted work
¨ EXAMS: Do not give assistance to or receive assistance from anyone
but professor
¨ Violations of this Code are treated seriously
¨ Evidence of cheating, plagiarism, or unauthorized collaboration will
result in a 0 grade for quiz/assignment/exam
¤ May have further consequences
How to get help?
7
¨ Email me
¨ Attendance
¤ Attend class regularly and on time
¤ Ask questions
¤ Work on in-class exercises and labs
¨ Notes
¤ Read over class notes before class
¤ Review class notes after class
¨ Homework
¤ Get started as early as possible
¤ Contact me if you encounter problems
COURSE OBJECTIVES
• Develop skills needed for designing correct and efficient
algorithms
• Gain familiarity with a number of classical problems that
occur frequently in real-world applications
• Inculcate skills to understand mathematical notations in
algorithms and their simple mathematical proofs,
particularly inductive proofs
• Understand basic data structures and to use them in
algorithms
COURSE OUTLINE
• Preliminaries : different types of algorithms, notations,
proof techniques, and limits.
• Elementary Algorithms : problems and instances,
efficiency of algorithms, analysis of algorithms,
examples of algorithms.
• Asymptotic Notation : different notations and their
graph examples, standard notations and their common
functions.
• Analysis of Algorithms : analysing control
structures, using barometer instruction, different
examples for analysis and solving recurrences.
COURSE OUTLINE
• Structures: use of arrays, stacks, queues, records,
pointers, lists, graphs, trees, associate tables, heaps
and binomial heaps.
• Tree Algorithms: understanding & making trees, and
their algorithms.
• Heap Algorithms : developing heaps, binomial heaps,
disjoint structures, and their algorithms,
• Greedy Algorithms : characteristics, minimum
spanning and shortest path algorithms.
Textbooks
Advised:
• Cormen, Leiserson, Rivest & Stein,
Introduction to Algorithms, 2ndEdition, The MIT
Press, 2001.
else
PHRASES FOR WRITING ALGORITHM
(ii) Repeat
until
PHRASES FOR WRITING ALGORITHM
(iv) do………
while
AN ALGORITHM FOR REPLYING
FRIEND’S LETTER
If right number
and person you want is available
then Have conversation
Replace receiver
else Replace receiver
Try again later
Until conversation completed
FLOW DIAGRAM SYMBOLS
START or END
process
input or output
decision
connector
FLOWCHART OF REPLYING TO A LETTER
FROM A FRIEND
START
END
START
A
read holiday leaflet
NO
is it in July?
Flowchart
YES
of accepting or
NO
is the cost less rejecting
than RS 8000?
YES
a holiday
YES
has he been
before?
NO
END A
START
YES
dial number
A
YES Number
unobtainable?
NO
NO
YES
engaged?
wait
is
someone NO
answering? waiting long
enough?
NO
insert money YES
A
continued…… B
A B
NO
right number?
NO is person you
want available?
have conversation
replace receiver
END
TYPE OF ALGORITHMS
• Probabilistic
• Approximate
• Heuristic
PROBABILISITIC ALGORITHM
3924 0981
2943 1962
1962 2943
981 3924
1210554 1210554
American English
MULTIPLICATION (981 x 1234)
(a la russe algorithm)
981 1234 1234
490 2468
245 4936 4936
122 9872
61 19744 19744
30 39488
15 78976 78976
7 157952 157952
3 315904 315904
1 631808 631808
1210554
MULTIPLICATION (0981 x 1234)
(Divide-and-Conquer Algorithm)
i) 09 12 4 108….
ii) 09 34 2 306..
iii) 81 12 2 972..
iv) 81 34 0 2754
1210554
MULTIPLICATION (09 x 12)
(Divide-and-Conquer Algorithm)
i) 0 1 2 0..
ii) 0 2 1 0.
iii) 9 1 1 9.
iv) 9 2 0 18
108
PARAMETERS FOR SELECTION
OF AN ALGORITHM
• Priority of Task
• Type of Available Computing Equipment
• Nature of Problem
• Speed of Execution
• Storage Requirement
• Programming Effort
A good choice can save both money and time,
and can successfully solve the problem
NOTATION OF PROGRAMS