mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Document missing functions
This commit is contained in:
parent
af82f5b0d3
commit
a365492f7e
1 changed files with 28 additions and 0 deletions
|
@ -15,8 +15,12 @@ See the [SRFI document](http://srfi.schemers.org/srfi-132/srfi-132.html) for mor
|
|||
- [`list-stable-sort`](#list-stable-sort)
|
||||
- [`vector-delete-neighbor-dups!`](#vector-delete-neighbor-dups-1)
|
||||
- [`vector-delete-neighbor-dups`](#vector-delete-neighbor-dups)
|
||||
- [`vector-find-median`](#vector-find-median)
|
||||
- [`vector-find-median!`](#vector-find-median-1)
|
||||
- [`vector-merge!`](#vector-merge-1)
|
||||
- [`vector-merge`](#vector-merge)
|
||||
- [`vector-select!`](#vector-select-1)
|
||||
- [`vector-separate!`](#vector-separate-1)
|
||||
- [`vector-sort!`](#vector-sort-1)
|
||||
- [`vector-sort`](#vector-sort)
|
||||
- [`vector-sorted?`](#vector-sorted)
|
||||
|
@ -95,6 +99,18 @@ This procedure does not alter its input vector, but rather newly allocates and r
|
|||
|
||||
This procedure reuses its input vector to hold the answer, packing it into the index range [start, newend), where newend is the non-negative exact integer that is returned as its value. The vector is not altered outside the range [start, newend).
|
||||
|
||||
# vector-find-median
|
||||
|
||||
(vector-find-median < v knil [ mean ])
|
||||
|
||||
This procedure does not alter its input vector, but rather newly allocates a vector to hold the intermediate result. Runs in O(n) time.
|
||||
|
||||
# vector-find-median!
|
||||
|
||||
(vector-find-median! < v knil [ mean ])
|
||||
|
||||
This procedure reuses its input vector to hold the intermediate result, leaving it sorted, but is otherwise the same as vector-find-median. Runs in O(n ln n) time.
|
||||
|
||||
# vector-merge
|
||||
|
||||
(vector-merge < v1 v2 [ start1 [ end1 [ start2 [ end2 ] ] ] ])
|
||||
|
@ -111,6 +127,18 @@ This procedure writes its result into vector `to`, beginning at index `start`, f
|
|||
|
||||
All four merge operations are stable: an element of the initial list `lis1` or vector `v1` will come before an equal-comparing element in the second list `lis2` or vector `v2` in the result.
|
||||
|
||||
# vector-select!
|
||||
|
||||
(vector-select! < v k [ start [ end ] ] )
|
||||
|
||||
This procedure returns the `k`th smallest element (in the sense of the `<` argument) of the region of a vector between `start` and `end`. Elements within the range may be reordered, whereas those outside the range are left alone. Runs in `O(n)` time.
|
||||
|
||||
# vector-separate!
|
||||
|
||||
(vector-separate! < v k [ start [ end ] ] )
|
||||
|
||||
This procedure places the smallest `k` elements (in the sense of the `<` argument) of the region of a vector between `start` and `end` into the first `k` positions of that range, and the remaining elements into the remaining positions. Otherwise, the elements are not in any particular order. Elements outside the range are left alone. Runs in `O(n)` time. Returns an unspecified value.
|
||||
|
||||
# vector-sort
|
||||
|
||||
(vector-sort < v [ start [ end ] ])
|
||||
|
|
Loading…
Add table
Reference in a new issue