{"name":"quickselect","version":"1.1.1","keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","_id":"quickselect@1.1.1","dist":{"shasum":"852e412ce418f237ad5b660d70cffac647ae94c2","tarball":"http://registry-npm.ywwl.com/quickselect/download/quickselect-1.1.1.tgz","fileCount":5,"integrity":"sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==","signatures":[{"sig":"MEQCIHST4oBfLtVAZoA49o60c7zb5EDXEF8+p25UnK3gG3cbAiBvcDbPqtHEPpUR6kHjuLsNObw/PdnOE0PpYXA7DRSEKw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5960,"size":2243,"noattachment":false,"key":"/quickselect/-/quickselect-1.1.1.tgz"},"main":"quickselect.js","files":["index.js","quickselect.js"],"gitHead":"c8b997fbd5fbbdca42307e738adefa7476cd5abe","scripts":{"test":"node -r esm test.js","bench":"node -r esm bench.js","build":"rollup -c","pretest":"eslint index.js test.js bench.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"_npmVersion":"5.6.0","description":"A tiny and fast selection algorithm in JavaScript.","directories":{},"_nodeVersion":"8.11.0","dependencies":{},"eslintConfig":{"extends":"mourner","parserOptions":{"sourceType":"module"}},"_hasShrinkwrap":false,"devDependencies":{"esm":"^3.0.15","tape":"^4.9.0","eslint":"^4.19.1","rollup":"^0.57.1","eslint-config-mourner":"^2.0.3"},"_npmOperationalInternal":{"tmp":"tmp/quickselect_1.1.1_1522844704524_0.477885608881943","host":"s3://npm-registry-packages"},"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":1522844704581,"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_cnpm_publish_time":1522844704581,"dist-tags":{"latest":"3.0.0"}}