Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.02 KB

algorithms.md

File metadata and controls

28 lines (20 loc) · 1.02 KB

Sorting algorithm complexity


algorithm time complexity (best, avg, worst) space stable
selection n^2   n^2   n^2 constant false
bubble n   n^2   n^2 constant true
insertion n   n^2   n^2 constant true
heap nlogn   nlogn   nlogn constant false
quick nlogn   nlogn   n^2 constant false
merge nlogn   nlogn   nlogn n true
bucket n + k   n + k   n + k nk
radix nk   nk   nk

Master Theorem

provides asymptotic analysis (time complexity) for many of the recursion algorithms that follow the patter of divide-and-conquer.

Primitive data type

• a basic data type provided by the programming language.

  • chars, int, floats, fixed-points, booleans, pointers

• a built-in type is a data type for which the programming language provides built-in support.

  • tuple, list, complex number, rational number, arrays
  • first-class function - JS, Lua, Go, Java, C++, C#