mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
15 lines (14 loc) • 441 B
JavaScript
module.exports = {
'name': 'partitionSelect',
'category': 'Matrix',
'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']
};