Sie sind auf Seite 1von 29

LECTURE 1

INTRODUCTION TO
ALGORITHM ANALYSIS
MS. ANDLEEB YOUSAF KHAN
FALL 2019
ABOUT THE COURSE

• In this course you will learn several fundamental and advanced principles of algorithm
design: divide-and-conquer methods, graph algorithms, practical data structures (heaps,
hash tables, search trees), randomized algorithms, greedy algorithms and applications;
dynamic programming and applications; Complexity classes and what it means for the
algorithm designer and more.
COURSE SYLLABUS (SUBJECT TO CHANGE)

• Introduction. Asymptotic analysis including big-oh notation. Divide-and-conquer algorithms


for sorting, counting inversions, matrix multiplication, and closest pair.
• Running time analysis of divide-and-conquer algorithms. The master method. Introduction to
randomized algorithms, with a probability review. QuickSort.
• More on randomized algorithms and probability. Computing the median in linear time. A
randomized algorithm for the minimum graph cut problem.
• Graph primitives. Depth- and breadth-first search. Connected components in undirected
graphs. Topological sort in directed acyclic graphs. Strongly connected components in
directed graphs.
COURSE SYLLABUS (SUBJECT TO CHANGE)

• Dijkstra's shortest-path algorithm. Introduction to data structures. Heaps and applications.


• Further data structures. Hash tables and applications. Balanced binary search trees.
• The greedy algorithm design paradigm. Applications to optimal caching and scheduling. Minimum
spanning trees and applications to clustering. The union-find data structure. Optimal data compression.
• The dynamic programming design paradigm. Applications to the knapsack problem, sequence alignment,
shortest-path routing, and optimal search trees.
• Intractable problems and what to do about them. NP-completeness and the P vs. NP question. Solvable
special cases. Heuristics with provable performance guarantees. Local search. Exponential-time
algorithms that beat brute-force search.
COURSE GROUP

• Edmodo Group: AA_Fall19


• Group Code: t54kpv
RECOMMENDED BOOKS

• Cormen/Leiserson/Rivest/Stein, Introduction to
Algorithms, 2009 (3rd edition).
• Algorithms in C++, Robert Sedgewick
• Mehlhorn/Sanders, Data Structures and Algorithms:The
Basic Toolbox, 2008.
WHAT IS AN ALGORITHM?

• An algorithm is a well-defined set of rules --- a recipe, in effect --- for solving a
computational problem.
• For example:
Given a list of numbers, rearrange them into sorted order;
Given a road network, an origin, and a destination, compute the shortest path from
the origin to the destination;
Given a set of tasks with deadlines, determine whether or not it is possible to
complete all the tasks by their deadlines.
WHY STUDY ALGORITHMS?

1. important for all other branches of


computer science
2. plays a key role in modern technological
innovation
WHY STUDY ALGORITHMS?

1. important for all other branches of computer science


2. plays a key role in modern technological innovation
• “Everyone knows Moore’s Law – a prediction made in 1965 by Intel co-founder
Gordon Moore that the density of transistors in integrated circuits would
continue to double every 1 to 2 years….in many areas, performance gains due
to improvements in algorithms have vastly exceeded even the dramatic
performance gains due to increased processor speed.”
• Excerpt from Report to the President and Congress: Designing a Digital Future, December 2010
(page 71).
WHY STUDY ALGORITHMS?

1. important for all other branches of computer


science
2. plays a key role in modern technological innovation
3. provides novel “lens” on processes outside of
computer science and technology
• quantum mechanics, economic markets, evolution
WHY STUDY ALGORITHMS?

1. important for all other branches of computer


science
2. plays a key role in modern technological innovation
3. provides novel “lens” on processes outside of
computer science and technology
4. challenging (i.e., good for the brain!)
WHY STUDY ALGORITHMS?

1. important for all other branches of computer science


2. plays a key role in modern technological innovation
3. provides novel “lens” on processes outside of computer
science and technology
4. challenging (i.e., good for the brain!)
5. fun
INTEGER MULTIPLICATION
KARATSUBA MULTIPLICATION
RECURSIVE APPROACH
ASSIGNMENT # 1

• Q1: Search internet for karatsuba multiplication method.


• Multiply 12345 with 9876.
• Q2: Suggest some other multiplication method. Give one example atleast.
• Submit by next Monday (BCS-5A)/Thursday (BCS-V:B)
SKILLS YOU’LL LEARN

• Become a better programmer


SKILLS YOU’LL LEARN

• Become a better programmer


• Sharpen your mathematical and analytical skills
SKILLS YOU’LL LEARN

• Become a better programmer


• Sharpen your mathematical and analytical skills
• Start “thinking algorithmically”
SKILLS YOU’LL LEARN

• Become a better programmer


• Sharpen your mathematical and analytical skills
• Start “thinking algorithmically”
• Literacy with computer science’s “greatest hits”
SKILLS YOU’LL LEARN

• Become a better programmer


• Sharpen your mathematical and analytical skills
• Start “thinking algorithmically”
• Literacy with computer science’s “greatest hits”
• Ace your technical interviews
GUIDING PRINCIPLE 1
GUIDING PRINCIPLE 2
GUIDING PRINCIPLE 3
WHAT IS A “FAST ALGORITHM”?

Das könnte Ihnen auch gefallen