next-core-sort
v2.2.0
Published
The Augmented.js Next - Sorting
Downloads
4
Maintainers
Readme
next-core-sort
Augmented.js Next Core - Sorting
API
Table of Contents
sortObjects
Sorts an array of objects by property in object (not a deep property)
Parameters
array
array The object array to sortkey
object The property to sort bydescending
boolean Reverse the order
Returns array The sorted array
mergeSort
Split the array into halves and merge them recursively
Parameters
array
array The array to sort
Returns array The sorted array
quickSort
Quick Sort implementation for Arrays -
Parameters
arr
Array Array to Sort
Returns Array Returns a sorted array
insertionSort
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
Parameters
array
array The array to sort
Returns array The sorted array
bubbleSort
Simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order.
Parameters
array
array The array to sort
Returns array The sorted array