{"name":"quickselect","version":"1.0.0","keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","_id":"quickselect@1.0.0","dist":{"shasum":"02630818f9aae4ecab26f0103f98d061c17c58f3","tarball":"http://registry-npm.ywwl.com/quickselect/download/quickselect-1.0.0.tgz","integrity":"sha512-MRyKfNC3jhWeKgqOeyNr249VE45ygtOd4QUn5vgOdndi+ayRdJkdiT3B9/9Hje4rUMxXb538T7wGFWKcPUfsrQ==","signatures":[{"sig":"MEQCIDDJf3rCtMz5AxuqONJrucU9R1WZzgvlcLLfmkbDUWJ6AiApsdhsxEJB6x8iucnk4mlJAc/oT/E3V+wsRDMWdeRv3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":1537,"noattachment":false,"key":"/quickselect/-/quickselect-1.0.0.tgz"},"main":"index.js","_from":".","_shasum":"02630818f9aae4ecab26f0103f98d061c17c58f3","gitHead":"f6ca6ce8bb412772ade017d2c78d38d74ef8070e","scripts":{"test":"tape test.js","pretest":"eslint index.js test.js"},"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"_npmVersion":"3.6.0","description":"A tiny and fast selection algorithm in JavaScript.","directories":{},"_nodeVersion":"5.6.0","dependencies":{},"devDependencies":{"tape":"^4.4.0","eslint":"^2.1.0","eslint-config-mourner":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/quickselect-1.0.0.tgz_1455713109131_0.2091331349220127","host":"packages-5-east.internal.npmjs.com"},"readme":"## quickselect\n\nA tiny and fast [selection algorithm](https://en.wikipedia.org/wiki/Selection_algorithm) in JavaScript\n(specifically, [Floyd-Rivest selection](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm)).\n\n```js\nquickselect(array, k[, left, right, compareFn]);\n```\n\nRearranges items so that all items in the `[left, k]` are the smallest.\nThe `k`-th element will have the `(k - left + 1)`-th smallest value in `[left, right]`.\n\n- `array`: the array to partially sort (in place)\n- `k`: middle index for partial sorting (as defined above)\n- `left`: left index of the range to sort (`0` by default)\n- `right`: right index (last index of the array by default)\n- `compareFn`: compare function\n\nExample:\n\n```js\nconst arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39];\n\nquickselect(arr, 8);\n\n// arr is [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95]\n//                                         ^^ middle index\n```\n","publish_time":1455713113399,"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_cnpm_publish_time":1455713113399,"dist-tags":{"latest":"3.0.0"}}