CS 411 Fall 2025 > Outline for October 8, 2025
CS 411 Fall 2025
Outline
for October 8, 2025
Outline
Closest Pair & Convex Hull (cont’d) [L 5.5]
See the October 6, 2025 lecture notes.
Transform and Conquer [L Ch 6 intro]
- Next algorithmic strategy: Transform and Conquer: transform instance of a problem to make problem easier to solve
- Note: Instance of a problem:
specific example of input for a problem.
Examples:
- An instance of the convex-hull problem is a collection of points in the plane.
- An instance of the sorting problem is a list.
- An instance of the selection problem is a list along with an index.
- An algorithm is given a REPRESENTATION
of an INSTANCE of a PROBLEM.
We can classify Transform and Conquer algorithms
by which of these they change.
- Instance simplification: replace the INSTANCE with an instance of the same problem, for which the problem is easier to solve.
- Representation change: Compute a different REPRESENTATION of the same instance.
- Problem reduction: Replace with an instance of a different PROBLEM, so that the solution to this new problem gives us the solution to the original problem.
- Transform and Conquer follows a two-stage process: transform problem, then solve transformed problem. When analyzing, consider efficiency of both stages.
Presorting [L 6.1]
- Idea: In a problem where we are given an arbitrary list,
sort the list, and then solve the same problem.
- Example of instance simplification.
- Sometimes best way to solve the problem.
- Example: finding a mode.
- Sometimes increases efficiency if same list will be reused.
- Example: search a list for a given key.
- If doing only one search, then Sequential Search is faster than sort + Binary Search.
- If doing many searches with different keys on same list, then sort + multiple calls to Binary Search is faster than multiple calls to Sequential Search.
- Example not found in text where presorting can help: given a list, are items all distinct?