{"_id":"quickselect","_rev":"10-9ec2bce99ac2edcf80032995de92f6b1","name":"quickselect","description":"A tiny and fast selection algorithm in JavaScript.","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"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","maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"dist":{"shasum":"02630818f9aae4ecab26f0103f98d061c17c58f3","tarball":"https://registry.npmjs.org/quickselect/-/quickselect-1.0.0.tgz","integrity":"sha512-MRyKfNC3jhWeKgqOeyNr249VE45ygtOd4QUn5vgOdndi+ayRdJkdiT3B9/9Hje4rUMxXb538T7wGFWKcPUfsrQ==","signatures":[{"sig":"MEQCIDDJf3rCtMz5AxuqONJrucU9R1WZzgvlcLLfmkbDUWJ6AiApsdhsxEJB6x8iucnk4mlJAc/oT/E3V+wsRDMWdeRv3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"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"}},"1.0.1":{"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","maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"dist":{"shasum":"1e6ceaa9db1ca7c75aafcc863c7bef2037ca62a1","tarball":"https://registry.npmjs.org/quickselect/-/quickselect-1.0.1.tgz","integrity":"sha512-Jt30UQSzTbxf6L2bFTMabHtGtYUzQcvOY0a+s5brm8tzndV/XWifBIH9v5QKtH5gGCZ5RRDwRhdhGMDVHAEGNQ==","signatures":[{"sig":"MEQCID80UTvm3KbOne1YURXAgrOFCL7Dl72KkDi6iDZORw25AiAnnFMhuoH4Kes/8FYoz0bBwJdd/3e3E2bWfozlK7WZvA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"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"}},"1.1.0":{"name":"quickselect","version":"1.1.0","keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","_id":"quickselect@1.1.0","maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"dist":{"shasum":"d09205c7eb52762c81e02c967d123694fb843108","tarball":"https://registry.npmjs.org/quickselect/-/quickselect-1.1.0.tgz","fileCount":5,"integrity":"sha512-M2/DoJ5wHDsWCcUW70gwnPMCl+L7ZehZlliHSzjkooMDtkosXV8uWUtrYDXgMRhw4BuMjaksDj7P1B+xKtOoRQ==","signatures":[{"sig":"MEYCIQDCsYLbO2nUsk2+cni+WeBK3/PiiY+Y7z2K1PN9PslLyQIhANJ4Dp0nee427SxGGYuLZ9yUrod1GDUJDU/cfIxslf88","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5984},"main":"quickselect.js","files":["index.js","quickselect.js"],"module":"index.js","gitHead":"26aaa258c2f57195d0b1d43a16894fef1c0c459b","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.0_1522758096806_0.22573084392681886","host":"s3://npm-registry-packages"}},"1.1.1":{"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","maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"dist":{"shasum":"852e412ce418f237ad5b660d70cffac647ae94c2","tarball":"https://registry.npmjs.org/quickselect/-/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},"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"}},"2.0.0":{"name":"quickselect","version":"2.0.0","keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","_id":"quickselect@2.0.0","maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"dist":{"shasum":"f19680a486a5eefb581303e023e98faaf25dd018","tarball":"https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz","fileCount":5,"integrity":"sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==","signatures":[{"sig":"MEYCIQCPTZeRX1xCpUd9B0vuEOKNXfcZ19+rrqmEXGJNAXdo4QIhALFBWRVOTkwVWyXTxj/cMC02ILpHWSF7mhGlyQbHlAH2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5984},"main":"quickselect.js","files":["index.js","quickselect.js"],"module":"index.js","gitHead":"85e11e63085274f28dab80e8134175f6ff1807c3","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_2.0.0_1522845012444_0.07345593570731324","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"quickselect","version":"3.0.0","type":"module","description":"A tiny and fast selection algorithm in JavaScript.","repository":{"type":"git","url":"git+https://github.com/mourner/quickselect.git"},"module":"index.js","main":"index.js","exports":"./index.js","devDependencies":{"eslint":"^9.6.0","eslint-config-mourner":"^4.0.1","esm":"^3.2.25","rollup":"^4.18.0","tape":"^5.8.1","typescript":"^5.5.3"},"scripts":{"pretest":"eslint *.js && tsc","test":"node test.js","bench":"node bench.js"},"types":"index.d.ts","keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","_id":"quickselect@3.0.0","gitHead":"c26429fd0a6f7b63b48a269e04748c34e8c0c5f4","bugs":{"url":"https://github.com/mourner/quickselect/issues"},"homepage":"https://github.com/mourner/quickselect#readme","_nodeVersion":"20.14.0","_npmVersion":"10.8.0","dist":{"integrity":"sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==","shasum":"a37fc953867d56f095a20ac71c6d27063d2de603","tarball":"https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz","fileCount":5,"unpackedSize":5287,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgnUbmQ2y0wDBLjBIhDnj2+73IFd97P6jqCH0w7bzbLAiEA/IGfB9a+buckUxr151OhH1ClJ4aqaLbNpf5ovvnn13k="}]},"_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"directories":{},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quickselect_3.0.0_1719998312530_0.8824770315142825"},"_hasShrinkwrap":false}},"time":{"created":"2016-02-17T12:45:13.399Z","modified":"2024-07-03T09:18:32.943Z","1.0.0":"2016-02-17T12:45:13.399Z","1.0.1":"2017-12-21T09:30:40.277Z","1.1.0":"2018-04-03T12:21:36.932Z","1.1.1":"2018-04-04T12:25:04.581Z","2.0.0":"2018-04-04T12:30:12.541Z","3.0.0":"2024-07-03T09:18:32.790Z"},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"author":{"name":"Vladimir Agafonkin"},"keywords":["selection","algorithm","quickselect","sort","partial","floyd","rivest"],"license":"ISC","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","readmeFilename":"README.md","users":{"shanewholloway":true},"homepage":"https://github.com/mourner/quickselect#readme","repository":{"type":"git","url":"git+https://github.com/mourner/quickselect.git"},"bugs":{"url":"https://github.com/mourner/quickselect/issues"}}