COMP6049001-Algorithm Design and Analysis-01
COMP6049001-Algorithm Design and Analysis-01
#include <iostream>
int main() {
std::cout << "Hello World! I am Sera (D3697)";
std::cout << "[email protected]";
return 0;
}
Materials
• COMP6049001-Algorithm Design and Analysis
• https://binusianorg-
my.sharepoint.com/personal/seraphina_binus_ac_id/_layouts/15/gu
estaccess.aspx?share=EmrQ7rireUtIh2_4F-
3YG4UBCvgbEDtpFg9ubigTSBQF4A&e=hyKZoF
Materials
• COMP6049001-Algorithm Design and Analysis
• https://binusianorg-
my.sharepoint.com/personal/seraphina_binus_ac_id/_layouts/15/gu
estaccess.aspx?share=EmrQ7rireUtIh2_4F-
3YG4UBCvgbEDtpFg9ubigTSBQF4A&e=hyKZoF
• http://astriani.com/ADA
Algorithm Design
and Analysis???
Other Resources
• Sedgewick, R. (2002). Algorithms in C++. Addison-
Wesley Publishing Company. ISBN: 9780201510591
• Skiena, S. S. (1998). The Algorithm Design Manual.
Springer Science & Business Media. ISBN: 0387948600,
9780387948607
• Relevant academic papers
Schedule
Week Topics References
1. • Introduction to Algorithm [T1] Ch. 1, 2
• Analyzing and Designing Algorithms
2. • Asymptotic Notations [T1] Ch. 3
3. • Divide and Conquer [T1] Ch. 4
4. • Sorting and Order Statistics [T1] Ch. 6, 7, 8, 9
5. • Data structures [T1] Ch. 10, 11, 12, 13
6. • Dynamic Programming [T1] Ch. 14
7. • Project Proposal Presentation N/A
8. • Greedy Algorithms [T1] Ch. 15
9. • Graph Algorithms [T1] Ch. 20, 21, 22
10. • Project Milestone Presentation N/A
11. • String Matching [T1] Ch. 32
12. • Summary/Quiz N/A
13. • Project Presentation N/A
Assessment
What is an Algorithm_.mp4
Algorithms
• Informally, 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.
http://www.digitaltechnologieshub.edu.au/images/default-source/topics/tile-images/algorithm.jpg
Algorithms
• Algorithm as a tool for solving a well-specified computational
problem
• 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)
http://www.trycomputing.org/sites/default/files/webform/upload/jumbled_numbers.jpg
Algorithms
• An algorithm is said to be correct if, for every input instance, it halts
with the correct output
• We say that a correct algorithm solves the given computational
problem
• An incorrect algorithm might not halt at all on some input instances, or it
might halt with an incorrect answer
http://www.coolthings.com/wp-content/uploads/2011/07/wrongulator1.jpg
Algorithms
• An algorithm can be specified in English, as a computer program, or
even as a hardware design.
What kinds of problems are solved by
algorithms?
• Sorting is by no means the only computational problem for which
algorithms have been developed.
https://www.geeksforgeeks.org/introduction-to-algorithms/
Group Discussion
Mentimeter
https://www.geeksforgeeks.org/introduction-to-algorithms/
• But……. you may someday encounter a problem for which you cannot
readily find a published algorithm
• This course will teach you techniques of algorithm design and analysis
so that you can develop algorithms on your own, show that they give
the correct answer, and understand their efficiency
https://flashdba.files.wordpress.com/2012/03/cookbook.jpg
Hard problems
• Most of our course discussed about efficient algorithms.
Do a Research
(you may discuss with your friends)
Answers:
1. They are similar, because each of then has to walk a graph and find a
path in them.
2. The difference is the constraint on the solution.
• The shortest-path requires just a path between two points
• The traveling salesman requires a path between more points that returns to the first
point.
Algorithms as a technology
• Suppose computers were infinitely fast and computer memory was
free.
• Would you have any reason to study algorithms?
https://mir-s3-cdn-cf.behance.net/project_modules/disp/9fe5e714270143.56280a63e1ee4.png
Algorithms as a technology
• Computing time is therefore a
bounded resource, and so is space
in memory.
http://www.qsys-ea.com/images/increased-efficiency.jpg
https://ds055uzetaobb.cloudfront.net/image_optimizer/22630368cbc032ea43967b2610e73ded399e22a4.png
Efficiency
Example:
• Sort
• Bubble sort
• Insertion sort
• Merge sort
• Etc.
Radix sort
• Computer – sort an array of 10 million numbers Recall: Bubble Sort.mp4
• Computer A (faster computer) -> more efficient
Code: Bubble Sort
• Computer B (slower computer)
Psssttt… you can use
https://www.onlinegdb.com/
Algorithms and other technologies
• Computer hardware as a technology
https://media.licdn.com/mpr/mpr/p/6/005/08c/33f/1b25a7a.jpg
Question
(you may googling ^_^)
• Give an example of an
application that requires
algorithmic content at the
application level, and discuss
the function of the
algorithms involved.
Answer
• Give an example of an application that requires algorithmic content at
the application level, and discuss the function of the algorithms
involved.
https://www.youtube.com/watch?v=biAB5iT3NXE
What is Big O Notation.mp4
Big O Notation
https://static1.squarespace.com/static/506e28cee4b04973cff61716/t/518eb7a0e4b0d03df1fe0cbc/1368307617566/Big+O+Notation+Summary.jpg
http://javaconceptoftheday.com/wp-content/uploads/2015/05/Big-O-Notation.png
How To “Calculate” Your Code Growth Rate?
Notes - Pseudocode:
The symbol “//” indicates that the
remainder of the line is a comment.
• Illustrate the operation of insertion sort and bubble sort on the array
A = (3, 41, 52, 26, 38, 57, 9, 49)
Which one is faster?
• Illustrate the operation of insertion sort and bubble sort on the array
A = (3, 9, 26, 29, 38, 49, 52, 49)
Which one is faster?
References
• Cormen, T. H., Leiserson, C. H., Rivest, R. L. & Stein, C. (2022).
Introduction to algorithms (4th ed.). Massachusetts Institute of
Technology. ISBN: 978-0262046305, 026204630X