All Projects → mourner → quickselect

mourner / quickselect

Licence: ISC license
A fast selection algorithm in JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to quickselect

PixelGlitch
Image glitch visualization using various Pixel Sorting methods for Processing
Stars: ✭ 25 (-65.75%)
Mutual labels:  sort, selection
array-sort-by
Powerful mechanism to sort arrays or array of objects by one or more properties. You can also specify a custom comparer function.
Stars: ✭ 37 (-49.32%)
Mutual labels:  sort
algos
A collection of algorithms in rust
Stars: ✭ 16 (-78.08%)
Mutual labels:  sort
text-editor
A text selection range API written in pure JavaScript, for modern browsers.
Stars: ✭ 24 (-67.12%)
Mutual labels:  selection
spring-boot-jpa-rest-demo-filter-paging-sorting
Spring Boot Data JPA with Filter, Pagination and Sorting
Stars: ✭ 70 (-4.11%)
Mutual labels:  sort
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (-49.32%)
Mutual labels:  sort
gson
Algorithms on data formats - JSON, CBOR, Collation.
Stars: ✭ 17 (-76.71%)
Mutual labels:  sort
Selectable
Touch enabled selectable plugin inspired by the jQuery UI widget.
Stars: ✭ 131 (+79.45%)
Mutual labels:  selection
xpclr
Code to compute the XP-CLR statistic to infer natural selection
Stars: ✭ 64 (-12.33%)
Mutual labels:  selection
Sorting-Algorithms
sorting algorithms in python
Stars: ✭ 15 (-79.45%)
Mutual labels:  sort
ultra-sort
DSL for SIMD Sorting on AVX2 & AVX512
Stars: ✭ 29 (-60.27%)
Mutual labels:  sort
wp-tag-order
↕︎ Sort tags manually in individual posts (not site-globally) on WordPress.
Stars: ✭ 16 (-78.08%)
Mutual labels:  sort
Tracking-with-darkflow
Real-time people Multitracker using YOLO v2 and deep_sort with tensorflow
Stars: ✭ 522 (+615.07%)
Mutual labels:  sort
sortboard
A small ES6 library for easy sorting and filtering of elements.
Stars: ✭ 29 (-60.27%)
Mutual labels:  sort
toggler
Atom plugin - Toggle words and symbols
Stars: ✭ 21 (-71.23%)
Mutual labels:  selection
Angular-Table-Sort-Component
Sorting Algorithm for sorting table values in angular
Stars: ✭ 18 (-75.34%)
Mutual labels:  sort
vscode-yaml-sort
This VS Code extension exposes the possibility to sort, format and validate yaml files.
Stars: ✭ 25 (-65.75%)
Mutual labels:  sort
Algorithms
Short explanations and implementations of different algorithms in multiple languages
Stars: ✭ 37 (-49.32%)
Mutual labels:  sort
myleetcode
♨️ Detailed Java & Python solution of LeetCode.
Stars: ✭ 34 (-53.42%)
Mutual labels:  sort
laravel-auto
Laravel Auto - a helper package to make automated lists with filters, sorting and paging like no other
Stars: ✭ 41 (-43.84%)
Mutual labels:  sort

quickselect Build Status

A tiny and fast selection algorithm in JavaScript (specifically, Floyd-Rivest selection).

quickselect(array, k[, left, right, compareFn]);

Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].

  • array: the array to partially sort (in place)
  • k: middle index for partial sorting (as defined above)
  • left: left index of the range to sort (0 by default)
  • right: right index (last index of the array by default)
  • compareFn: compare function

Example:

var arr = [65, 28, 59, 33, 21, 56, 22, 95, 50, 12, 90, 53, 28, 77, 39];

quickselect(arr, 8);

// arr is [39, 28, 28, 33, 21, 12, 22, 50, 53, 56, 59, 65, 90, 77, 95]
//                                         ^^ middle index
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].