next-core-sort

2.2.0 • Public • Published

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 sort
  • key object The property to sort by
  • descending 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

Package Sidebar

Install

npm i next-core-sort

Weekly Downloads

1

Version

2.2.0

License

Apache-2.0

Unpacked Size

665 kB

Total Files

38

Last publish

Collaborators

  • thedocbwarren