mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
15 lines
440 B
JavaScript
15 lines
440 B
JavaScript
module.exports = {
|
|
'name': 'partitionSelect',
|
|
'category': 'Utils',
|
|
'syntax': [
|
|
'partitionSelect(x, k)',
|
|
'partitionSelect(x, k, compare)'
|
|
],
|
|
'description': 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',
|
|
'examples': [
|
|
'partitionSelect([5, 10, 1], 2)',
|
|
'partitionSelect(["C", "B", "A", "D"], 1)'
|
|
],
|
|
'seealso': ['sort']
|
|
};
|