array_sorting_package

1.0.0 • Public • Published

This package contains JavaScript implementations of various sorting algorithms:

  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. Merge Sort
  5. Quick Sort

Bubble Sort

  • Function Name: bubbleSort
  • Description: Sorts an array by repeatedly swapping the adjacent elements if they are in the wrong order.
  • Time Complexity: O(n^2)

Selection Sort

  • Function Name: selectionSort
  • Description: Sorts an array by repeatedly selecting the minimum element from the unsorted portion and placing it at the beginning.
  • Time Complexity: O(n^2)

Insertion Sort

  • Function Name: insertionSort
  • Description: Sorts an array by inserting each element into its correct position in the sorted portion of the array.
  • Time Complexity: O(n^2)

Merge Sort

  • Function Name: mergeSort
  • Description: Sorts an array by dividing it into two halves, sorting each half recursively, and then merging them together.
  • Time Complexity: O(n log n)

Quick Sort

  • Function Name: quickSort
  • Description: Sorts an array by selecting a pivot element and partitioning the array into two sub-arrays around the pivot.
  • Time Complexity: O(n log n)

Readme

Keywords

none

Package Sidebar

Install

npm i array_sorting_package

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

3.56 kB

Total Files

3

Last publish

Collaborators

  • andrew528