{"name":"quickselect","version":"1.0.1","keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","_id":"quickselect@1.0.1","dist":{"shasum":"1e6ceaa9db1ca7c75aafcc863c7bef2037ca62a1","tarball":"http://registry-npm.ywwl.com/quickselect/download/quickselect-1.0.1.tgz","integrity":"sha512-Jt30UQSzTbxf6L2bFTMabHtGtYUzQcvOY0a+s5brm8tzndV/XWifBIH9v5QKtH5gGCZ5RRDwRhdhGMDVHAEGNQ==","signatures":[{"sig":"MEQCID80UTvm3KbOne1YURXAgrOFCL7Dl72KkDi6iDZORw25AiAnnFMhuoH4Kes/8FYoz0bBwJdd/3e3E2bWfozlK7WZvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":1759,"noattachment":false,"key":"/quickselect/-/quickselect-1.0.1.tgz"},"main":"index.js","gitHead":"631efe5734122190d480ba394bde96f5bcd70e3e","scripts":{"test":"tape test.js","pretest":"eslint index.js test.js"},"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"_npmVersion":"5.6.0","description":"A tiny and fast selection algorithm in JavaScript.","directories":{},"_nodeVersion":"9.2.0","dependencies":{},"devDependencies":{"tape":"^4.4.0","eslint":"^2.1.0","eslint-config-mourner":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/quickselect-1.0.1.tgz_1513848639385_0.11995588219724596","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":1513848640277,"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_cnpm_publish_time":1513848640277,"dist-tags":{"latest":"3.0.0"}}