# partition

(definition)

**Definition:**
(1) A division of a *set* into nonempty *disjoint sets* that completely cover the set. (2) To rearrange the elements of an *array* into two (or more) groups, typically, such that elements in the first group are less than a value and elements in the second group are greater.

**Formal Definition:** (1) A partition P of a set S is a set of subsets with the following properties:

- ∀ s
_{i} ∈ P, s_{i} ≠ ø

(no subset is empty), - ∀ s
_{i}, s_{j} ∈ P, i ≠ j → s_{i} ∩ s_{j} = ø

(subsets are disjoint), and -
**U**_{i=1} s_{i} = S

(subsets exactly cover the original).

Thanks to Julio A. Cartaya <jac@puma.mt.att.com>.

**Generalization** (I am a kind of ...)

*set*.

**Specialization** (... is a kind of me.)

*select and partition*.

**Aggregate parent** (I am a part of or used in ...)

*quicksort*, *Dutch national flag*, *American flag sort*.

**See also**
*set packing*, *subset*, *connected components*.

Author: PEB

## Implementation

generating partitions (Fortran, Mathematica, Pascal, and C), (Scheme)

Go to the
Dictionary of Algorithms and Data
Structures home page.

If you have suggestions, corrections, or comments, please get in touch
with
Paul E. Black.

Entry modified 14 August 2008.

HTML page formatted Tue Dec 6 16:16:32 2011.

Cite this as:

Paul E. Black, "partition", in
*Dictionary of Algorithms and Data
Structures* [online], Paul E. Black, ed.,
U.S. National Institute of
Standards and Technology. 14 August 2008. (accessed TODAY)
Available from: http://www.nist.gov/dads/HTML/partition.html