Teach Time Encyclopedia - Learn About Our World
Home Page
Teach Time
Featured Topics

United States
by state

CITYology

Academic Disciplines

Historical Timelines

Themed Timelines

Calendars

Reference Tables

Biographies

How-tos



Monday, September 08, 2008

Divide and conquer (computer science)

In computer science, divide and conquer is an algorithm design paradigm that works by recursively breaking down a problem into two or more sub-problems of the same (or related) type.

The sub-problems are independently solved and their solutions are combined to give a solution to the original problem. This technique has been applied to many well-known problems, such as sorting (e.g. quicksort and merge sort) and fast Fourier transforms. The divide-and-conquer approach provides (at least) three potential benefits, in algorithm design, complexity, and cache locality.

First, it can provide a simple approach to solving conceptually difficult problems, such as the classic Tower of Hanoi puzzle, by reducing the problem size recursively until a trivial base case is reached.

Second, even if a solution to the full problem is already known (e.g. for sorting, a brute-force comparison of all elements with one another), divide and conquer can substantially reduce the computational cost (complexity). For example, if the original problem requires O(n²) work for a problem of size n, and the combination (conquer) step of two halves only requires O(n) work, then a divide-and-conquer algorithm reduces the complexity to O(n log n).

Third, explicitly recursive subdivision can have cache benefits, since eventually the problem reaches a size that fits in cache, whatever the size of the cache(s) might be. Using divide-and-conquer, one can even design an algorithm to use all levels of the cache hierarchy in an asymptotically optimal fashion, without knowing the size of the cache or including it as an explicit parameter. Such an algorithm is called (optimal) cache-oblivious, and this approach has been successfully applied to sorting, FFTs, matrix multiplication, and other problems. (The standard alternative approach, blocking the problem into chunks the size of the cache, requires that a program be altered whenever it is run a new machine with a different set of cache sizes.)

See: Akra-Bazzi Method

References

  • M. Frigo, C. E. Leiserson, and H. Prokop, Cache-Oblivious Algorithms, Proc. 40th Symp. on the Foundations of Computer Science (1999).


Internet Hotel Solutions

Site Sponsors
AC Units
Baltimore Harbor
Boot Camp Grads
Bra Size
Burkittsville
College Hotels
Digital Harbor
Free Cell Phones
Golden Hare Travel
Golf Vacations
Golf Courses
Gourmet
Hair Styles
Hippodrome
iWoman
Lesson Plans
Maryland Hotels
MD Genealogy
Minor League Stuff
Motel Site
Ocean City
OC Real Estate
Old Agers
Office Supplies
Orlando
Pet Friendly Hotel
Room Prices
Savannah, GA
Ski Vacations
South Baltimore
Student Teaching
Travel Sources
University Hotels
Visit Military Bases
Washington, DC

Brought to you by NoChildLeftBehind.com and the Beaches and Towns Network, LLC.