Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

알고리즘3주숙제

From ZeroWiki

Examples

from The university of liverpool of Computer Science Department

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

[1] 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 Divide and conquer lab exercises