Introduction To Algorithms Lec 4
Introduction To Algorithms Lec 4
Introduction to Algorithms
WHAT IS AN ALGORITHM?
problem
algorith
m
Algorithmic solution
SOME WELL-KNOWN
COMPUTATIONAL PROBLEMS
Sorting
A Sorting Algorithm is used to rearrange a given array or list elements according to a comparison operator on the
elements.
Searching
Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is
graph such that the sum of the weights of its constituent edges is minimized.
undirected graph that connects all the vertices together, without any cycles and with the minimum possible total
edge weight
SOME WELL-KNOWN
COMPUTATIONAL PROBLEMS
Traveling salesman problem
Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route
that visits every city exactly once and returns to the starting point
Knapsack problem
The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and
a value, determine the number of each item to include in a collection so that the total weight is less than or
Chess
Towers of Hanoi
ALGORITHM DESIGN
STRATEGIES
Brute force
Divide and conquer
Decrease and conquer
Transform and conquer
Greedy approach
Dynamic programming
Backtracking and Branch and bound
Space and time tradeoffs
ANALYSIS OF ALGORITHMS
Theoretical importance
The core of computer
science
Practical importance
A practitioner’s toolkit of known algorithms
Framework for designing and analyzing algorithms
for new problems