Algorithm Reviewer
Algorithm Reviewer
Types of Problems in Designing and Analyzing – finding a given value called the “search key”
Algorithms in a given list or set.
● Sorting Problem – Searching Algorithm are necessary for
storing and retrieving information from large
● Searching Problem
databases.
● String Processing Problem
● Linear search – examines a sequence of
● Graph Problem data objects one by one.
● Combinatorial problems
● Geometrical problems
● Numerical problems
Sorting Problem
– rearrange the items of a given list in
ascending order
● Binary search – more sophisticated strategy
and is faster than linear search when searching
a large array.
Graph Problem
– It deals with objects and their connections
like determining whether all of the locations are
connected.
It is also useful for real-life applications:
● Transportation ● Project scheduling
● Communication ● Games
Combinatorial problems
● Social and economic networks – to find a combination of an object such as
permutation, combination, or a subset that
satisfies certain constraints
Basic Graph Algorithms
● Traveling Salesman Problem (TSP)
● Graph-traversal algorithms – It deals with
how one can reach all the points in a network.
– It deals with finding the shortest tour through
𝑛𝑛 cities that visits every city exactly once.
Examples: Route planning, Circuit board, etc.
Analysis of an Algorithm
● Graph-coloring problem
– means to investigate an algorithm’s efficiency
– It deals with assigning the smallest number with respect to resources:
of colors to the vertices of a graph so that no ○ running time (time efficiency) and memory
two (2) adjacent vertices are the same color. space (space efficiency)
Example: Event scheduling – If the events are ○ Time being more critical than space
represented by vertices that are connected by
an edge
STEPS:
○ Implement the algorithm completely.
○ Determine the time required for each basic
operation.
○ Identify unknown quantities that can be used
to describe the frequency of execution of the
basic operations.
○ Develop a realistic model for the input to the
Geometrical problems program.
– It deals with geometric objects such as ○ Analyze the unknown quantities, assuming
points, lines, and polygons. the modelled input.
Two (2) Classic Problems of Computational ○ Calculate the total running time by
Geometry multiplying the time by the frequency for each
operation, then adding all the products.
● Closest-pair problem – is self-explanatory;
given 𝑛𝑛 points in the plane, find the closest
pair among them. What is an efficient algorithm?
● Convex-hull problem – asks to find the ○ Efficiency – signifies a level of performance
smallest convex polygon that would include all that describes using the least amount of input
the points of a given set. to achieve the highest amount of output.