Examples

from The university of liverpool of Computer Science Department(http://www.csc.liv.ac.uk/~ped/teachadmin/algor/d_and_c.html)

BinarySearch

Consider the following problem: one has a directory containing a set of names and a telephone number associated with each name.

The directory is sorted by alphabetical order of names. It contains n entries which are stored in 2 arrays:

names (1..n) ; numbers (1..n)

Given a name and the value n the problem is to find the number associated with the name.

Closest Set

Input:

P = {p(1), p(2) ,..., p(n) }

where p(i) = ( x(i), y(i) ).

A set of n points in the plane.

Output

The distance between the two points that are closest.

Note: The distance DELTA( i, j ) between p(i) and p(j) is defined by the expression:

Square root of { (x(i)-x(j))^2 + (y(i)-y(j))^2 }

Integer Multiplication

http://www.csc.liv.ac.uk/~ped/teachadmin/algor/pic4.gif
The (2n)-digit decimal representation of the product x*y = z
Note: The algorithm below works for any number base, e.g. binary, decimal, hexadecimal, etc. We use decimal simply for convenience.

Exercises

from University of Calgary Dept.CS(http://pages.cpsc.ucalgary.ca/~jacobs/Courses/cpsc413/W05/)
Divide and conquer lab exercises(http://pages.cpsc.ucalgary.ca/~jacobs/Courses/cpsc413/W05/labs/DivideConquer.pdf)
Retrieved from http://wiki.zeropage.org/wiki.php/알고리즘3주숙제
last modified 2021-02-07 05:30:20