アルゴリズム複雑度まとめ!


ちょうど1つのとても良いアルゴリズムの複雑さの総括する貼ることを見て、思い切って回転しました。
原文のリンク:http://bigocheatsheet.com/#
お父さん、これらの表は完全に表示することができなくて、みんなは上のリンクをつけて原文を見ることができます。
Searching
Algorithm
Data Structure
Time Coplexity
Space Coplexity
Average
World
World
Depth First Search(DFS)
Graph of|V𞓜vertices and|E edges-O(|E| + |V|)O(|V|)Breadth First Search(BFS)
Graph of|V𞓜vertices and|E edges-O(|E| + |V|)O(|V|)Binary search
Sorted array of n elemensO(log(n))O(log(n))O(1)Linear(Brute Force)
ArayO(n)O(n)O(1)Shotest path by Dijkstra、using a Min-heap as priority queue
Graph with|V vertices and𞓜E edgesO((|V| + |E|) log |V|)O((|V| + |E|) log |V|)O(|V|)Shotest path by Dijkstra、using an unsorted array as prorit queue
Graph with|V vertices and𞓜E edgesO(|V|^2)O(|V|^2)O(|V|)Shotest path by Bellman-Ford
Graph with|V vertices and𞓜E edgesO(|V||E|)O(|V||E|)O(|V|)Sorting
Algorithm
Data Structure
Time Coplexity
Word Case Auxiliary Space Coplexity
 
 
ベスト
Average
World
World
Quicksort
ArayO(n log(n))O(n log(n))O(n^2)O(n)Mergsort
ArayO(n log(n))O(n log(n))O(n log(n))O(n)Heappsort
ArayO(n log(n))O(n log(n))O(n log(n))O(1)Bbble Sort
ArayO(n)O(n^2)O(n^2)O(1)インセプション?ソート
ArayO(n)O(n^2)O(n^2)O(1)Select Sort
ArayO(n^2)O(n^2)O(n^2)O(1)Butet Sort
ArayO(n+k)O(n+k)O(n^2)O(nk)Radix Sort
ArayO(nk)O(nk)O(nk)O(n+k)Data Structures
Data Structure
Time Coplexity
Space Coplexity
 
Average
World
World
 
Indexing
Search
Insertion
Deletion
Indexing
Search
Insertion
Deletion
 
Baic ArayO(1)O(n)--O(1)O(n)--O(n)Dynamic ArayO(1)O(n)O(n)O(n)O(1)O(n)O(n)O(n)O(n)Singly-linked ListO(n)O(n)O(1)O(1)O(n)O(n)O(1)O(1)O(n)Doubly-linked ListO(n)O(n)O(1)O(1)O(n)O(n)O(1)O(1)O(n)スキップリストO(log(n))O(log(n))O(log(n))O(log(n))O(n)O(n)O(n)O(n)O(n log(n))Hash Table-O(1)O(1)O(1)-O(n)O(n)O(n)O(n)Binary Search TreeO(log(n))O(log(n))O(log(n))O(log(n))O(n)O(n)O(n)O(n)O(n)Catresian Tree-O(log(n))O(log(n))O(log(n))-O(n)O(n)O(n)O(n)B-TreeO(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(n)Red-Black TreeO(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(n)Splay Tree-O(log(n))O(log(n))O(log(n))-O(log(n))O(log(n))O(log(n))O(n)AVL TreeO(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(n)Heapps
Heapps
Time Coplexity
 
Heappify
Find Max
Extract Max
Increase Key
インセンス
Delete
Merge
 
Linked List(sorted)-O(1)O(1)O(n)O(n)O(1)O(m+n)Linked List(unsorted)-O(n)O(n)O(1)O(1)O(1)O(1)Binary HeapO(n)O(1)O(log(n))O(log(n))O(log(n))O(log(n))O(m+n)Binomial Heap-O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))O(log(n))Fibonacci Heap-O(1)O(log(n))*O(1)*O(1)O(log(n))*O(1)Graphs
Node/Edge Management
Strage
Add Vetex
Add Edge
Remove Vetex
Remove Edge
Query
Adjacency listO(|V|+|E|)O(1)O(1)O(|V| + |E|)O(|E|)O(|V|)Incidence listO(|V|+|E|)O(1)O(1)O(|E|)O(|E|)O(|E|)Adjacency matrixO(|V|^2)O(|V|^2)O(1)O(|V|^2)O(1)O(1)Incidence matrixO(|V| ⋅ |E|)O(|V| ⋅ |E|)O(|V| ⋅ |E|)O(|V| ⋅ |E|)O(|V| ⋅ |E|)O(|E|)Notation for asymptotic growth
letter
bound
growth
(theta)Θ
uper and lower,tight[1]
equal[2]
(big-oh)O
up per,tightnes unknown
less than or equal[3]
(small-oh)o
スーパー、not tight
less than
(big omega)Ω
lower,tightnes unknown
greater than or equal
(small omega)ω
lower,not tight
greater than
[1]Big O is the up per bound,while Omega is the lower bound.Thtarequires both Big O and Omega、so that's why its referred to a s a tightbound(itmusst be both the uup per and lowewer lowewewer bobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobobod.TaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTaTale le InInInInInInInInInInInInInInInInInInInInInInInInInInInInInInInalgorithm tang Thta(n logn)is far preferential since it taes AT LEAST n logn(Omega n logn)and NO MORE THAN n logn(Big O n logn).SO
[2]f(x)=Θ(g(n)means f(the running time of the algorithm)grows exactly like g when(input size)gets larger.In other wods,the growth rate of f(x)is asymptotical proporation to g(n.)
[3]Same thing.Here the growth rate isのfaster than g(n).big-oh is the most useful because represents the wost-case behavior.
Inショート、if algorithm is_uthen its performance is_u
algorithm
performance
o(n)
O(n)
≦n
Θ(n)
=n
Ω(n)
≧n
ω(n)
>n
を選択します
Big-O Coplexity Chart
Conttribute Edit these tables!
Authors:
  • エリックRowell
  • Quentin Pleple
  • Nick Dizzo
  • Michael Abed
  • Adam Forsyth
  • Jay Engeer
  • Josh Davis
  • makos blade
  • Alejandro Ramirez
  • Joel Fridly
  • Robert Burke
  • David Durfman
  • Erric Lefevre-Ardant
  • トーマスDybadahl Ahle