Gathering detailed insights and metrics for quickselect.js
Gathering detailed insights and metrics for quickselect.js
Gathering detailed insights and metrics for quickselect.js
Gathering detailed insights and metrics for quickselect.js
Quickselect implementation on javascript. Finding the k-th smallest element in an unordered list.
npm install quickselect.js
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
1,334
Last Day
2
Last Week
2
Last Month
26
Last Year
171
MIT License
11 Commits
2 Watchers
3 Branches
1 Contributors
Updated on Jan 28, 2023
Minified
Minified + Gzipped
Latest Version
0.1.4
Package Id
quickselect.js@0.1.4
Unpacked Size
6.25 kB
Size
2.78 kB
File Count
9
NPM Version
6.14.5
Node Version
12.16.1
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
-71.4%
2
Compared to previous week
Last Month
-7.1%
26
Compared to previous month
Last Year
54.1%
171
Compared to previous year
See: https://en.wikipedia.org/wiki/Quickselect
1/** 2 * @param {Array} array - Data 3 * @param {Number} k - Position of smallest element (starts from 0) 4 * @param {Function} accessor - Function which return value for processing (optional) 5 */ 6const element = quickSelect(array, k, accessor)
1npm i quickselect.js
or
1yarn add quickselect.js
1const data = [7, 10, 4, 3, 20, 15] 2const k = 2 3const element = quickSelect(data, k) 4console.log(element) // 7
or
1const dataWithObjects = [ 2 { value: 7 }, 3 { value: 10 }, 4 { value: 4 }, 5 { value: 3 }, 6 { value: 20 }, 7 { value: 15 }, 8] 9const k = 2 10const element = quickSelect(dataWithObjects, k, item => item.value) 11console.log(element) // { value: 7 }
1const quickSelectMedian = array => { 2 const { length } = array 3 if (length % 2) { 4 return quickSelect(array, length / 2) 5 } 6 return ( 7 0.5 * (quickSelect(array, length / 2 - 1) + quickSelect(array, length / 2)) 8 ) 9}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
27 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More