maTH
  • 👋Welcome!
  • 🗿Installation
  • Reference
    • 😱Mathematical operations
      • add
      • pascal
      • factorial
      • factorialL
      • GCD
      • LCM
      • pow
      • permutations
      • combinations
      • combinationsWithRep
      • subtract
      • multiply
      • divide
      • sin
      • cos
      • ln
      • log
      • radToDeg
      • degToRad
      • mod
      • abs
      • floor
      • ceil
      • root
      • exp
      • tan
      • arcsin
      • arccos
      • arctan
      • sinh
      • cosh
      • round
    • 🥶Statistics
      • Binomial
      • Poisson
      • Geometric
      • Pascal
      • Hypergeometric
      • Exponential
      • Uniform
    • 🥵Data structures
      • Stack
      • Queue
      • LinkedList
    • 🤓Algorithms
      • Bubble sort
      • Insertion sort
      • Selection sort
      • Merge sort
      • Quicksort
      • Heap sort
      • Count sort
      • Bucket sort
      • Radix sort
    • 😳Constants
Powered by GitBook
On this page
  1. Reference

Algorithms

PreviousLinkedListNextBubble sort

Last updated 2 months ago

In the updated version of the maTH library, we can also use sorting (currently, maybe more diverse in future) algorithms, so there is no need to write your own. It supports the following algorithms:

Algorithm
O notation (best, average, worst case)
Source

Bubble sort

, ,

Insertion sort

, ,

Selection sort

, ,

Merge sort

, ,

Quicksort

, ,

Heap sort

, ,

Count sort

, ,

Bucket sort

, ,

Radix sort

, ,

🤓
O(n2)O(n^2)O(n2)
O(n2)O(n^2)O(n2)
O(n2)O(n^2)O(n2)
O(n)O(n)O(n)
O(n2)O(n^2)O(n2)
O(n2)O(n^2)O(n2)
O(n2)O(n^2)O(n2)
O(n2)O(n^2)O(n2)
O(n2)O(n^2)O(n2)
O(nlogn)O(n log n)O(nlogn)
O(nlogn)O(n log n)O(nlogn)
O(nlogn)O(n log n)O(nlogn)
O(nlogn)O(n log n)O(nlogn)
O(nlogn)O(n log n)O(nlogn)
O(n2)O(n^2)O(n2)
O(nlogn)O(n log n)O(nlogn)
O(nlogn)O(n log n)O(nlogn)
O(nlogn)O(n log n)O(nlogn)
O(n+k)O(n + k)O(n+k)
O(n+k)O(n + k)O(n+k)
O(n+k)O(n + k)O(n+k)
O(n+k)O(n + k)O(n+k)
O(n)O(n)O(n)
O(n2)O(n^2)O(n2)
O(nk)O(nk)O(nk)
O(nk)O(nk)O(nk)
O(nk)O(nk)O(nk)
Bubble sort
Insertion sort
Selection sort
Merge sort
Quicksort
Heap sort
Count sort
Bucket sort
Radix sort