Shawn's blog Shawn's blog
About Me
  • Category
  • Tag
  • Archive
GitHub (opens new window)

Shawn Jin

I am not a creator of knowledge, I am just a porter of knowledge.
About Me
  • Category
  • Tag
  • Archive
GitHub (opens new window)
  • data-structure

  • searching

  • sorting

    • Basic Sorting Algorithm
      • Sorting Algorithms
    • Leetcode: Sorted Array Median
  • Algorithm
  • sorting
Shawn Jin
2019-08-16

Basic Sorting Algorithm

# Sorting Algorithms

Sorting Algorithm Time Complex(Average) Space Complex isStable isComplex
Insertion Sort O(n^2) O(1) Stable Simple
Shell Sort O(n^1.3) O(1) Unstable Complex
Bubble Sort O(n^2) O(1) Stable Simple
Quick Sort O(nlog2(n)) O(log2(n)) Unstable Complex
Selection Sort O(n^2) O(1) Unstable Complex
Stack Sort O(nlog2(n)) O(1) Unstable Complex
Merge Sort O(nlog2(n)) O(n) Stable Complex
Radix Sort O(d(n+r)) O(r) Stable Complex
::: tip
- Stable Algorithm: A sorting algorithm is stable if two objects with equal keys appear in the same order in sorted output as they appear in input array to be sorted.
- Complex Algorithm: A complex algorithm is defined as an algorithm that embodies mathematical or logical methods and requires at least one thousand lines of the C programming language to implement. Reference (opens new window)
Updated: 2021/09/06, 21:27:01
Leetcode: Happy Number
Leetcode: Sorted Array Median

← Leetcode: Happy Number Leetcode: Sorted Array Median→

最近更新
01
Python import files from different directories
12-31
02
Classmethod in Python
09-15
03
Single/Double Star (/*) Parameters in Python
09-15
更多文章>
Theme by Vdoing | Copyright © 2019-2021 Shawn Jin | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式