Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Covering ¶
type Covering []Range
Covering represents a non-overlapping, but possibly non-contiguous, set of intervals.
type Range ¶
Range is an interval with a payload.
func OverlapCoveringMerge ¶
OverlapCoveringMerge returns the set of intervals covering every range in the input such that no output range crosses an input endpoint. The payloads are returned as a `[]interface{}` and in the same order as they are in coverings.
Example:
covering 1: [1, 2) -> 'a', [3, 4) -> 'b', [6, 7) -> 'c' covering 2: [1, 5) -> 'd' output: [1, 2) -> 'ad', [2, 3) -> `d`, [3, 4) -> 'bd', [4, 5) -> 'd', [6, 7) -> 'c'
The input is mutated (sorted). It is also assumed (and not checked) to be valid (e.g. non-overlapping intervals in each covering).
Click to show internal directories.
Click to hide internal directories.