boristane / arr-sorting Goto Github PK
View Code? Open in Web Editor NEWSort an array using various popular sorting algorithms.
License: MIT License
Sort an array using various popular sorting algorithms.
License: MIT License
Sorts an array using the shell sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
shell(arr); // [2, 5, 5, 6, 10, 32]
shell(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the introsort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
intro(arr); // [2, 5, 5, 6, 10, 32]
intro(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
The current quick sort function uses the Lamuto partition scheme. The Hoare partition scheme is more efficient and would be a good enhancement.
Sorts an array using the smooth sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
smooth(arr); // [2, 5, 5, 6, 10, 32]
smooth(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Edit README to explain each algorithm.
Sorts an array using the quick sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
quick(arr); // [2, 5, 5, 6, 10, 32]
quick(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the tree sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
tree(arr); // [2, 5, 5, 6, 10, 32]
tree(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the timsort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
tim(arr); // [2, 5, 5, 6, 10, 32]
tim(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the binary sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
binary(arr); // [2, 5, 5, 6, 10, 32]
binary(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the merge sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
merge(arr); // [2, 5, 5, 6, 10, 32]
merge(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the selection sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
selection(arr); // [2, 5, 5, 6, 10, 32]
selection(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the insertion sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
insertion(arr); // [2, 5, 5, 6, 10, 32]
insertion(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
Sorts an array using the heap sort algorithm.
const arr = [2, 5, 10, 5, 32, 6];
heap(arr); // [2, 5, 5, 6, 10, 32]
heap(arr, (a, b) => b - a); // [32, 10, 6, 5, 5, 2]
Update README.md.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.