๐ป Programming
๋ฐ์ดํฐ ๊ตฌ์กฐ, ์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ ๋ณ ์๊ฐ ๋ณต์ก๋ ๋ฐ ๊ณต๊ฐ ๋ณต์ก๋ ์์ฝ ํ
Legend
Excellent |
Good |
Fair |
Bad |
Horrible |
์๋ฃ๊ตฌ์กฐ๋ณ ์๊ฐ๋ณต์ก๋ ๋ฐ ๊ณต๊ฐ๋ณต์ก๋
์๋ฃ๊ตฌ์กฐ | ์๊ฐ ๋ณต์ก๋ | ๊ณต๊ฐ๋ณต์ก๋ | |||||||
---|---|---|---|---|---|---|---|---|---|
Average | Worst | Worst | |||||||
Access | Search | Insertion | Deletion | Access | Search | Insertion | Deletion | ||
Array | O(1) |
O(n) |
O(n) |
O(n) |
O(1) |
O(n) |
O(n) |
O(n) |
O(n) |
Stack | O(n) |
O(n) |
O(1) |
O(1) |
O(n) |
O(n) |
O(1) |
O(1) |
O(n) |
Singly-Linked List | O(n) |
O(n) |
O(1) |
O(1) |
O(n) |
O(n) |
O(1) |
O(1) |
O(n) |
Doubly-Linked List | O(n) |
O(n) |
O(1) |
O(1) |
O(n) |
O(n) |
O(1) |
O(1) |
O(n) |
Skip List | 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 Tree | O(log(n)) |
O(log(n)) |
O(log(n)) |
O(log(n)) |
O(n) |
O(n) |
O(n) |
O(n) |
O(n) |
Cartesian Tree | - |
O(log(n)) |
O(log(n)) |
O(log(n)) |
- |
O(n) |
O(n) |
O(n) |
O(n) |
B-Tree | O(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 Tree | O(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 Tree | O(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) |
์ ๋ ฌ ์๊ณ ๋ฆฌ์ฆ ์๊ฐ๋ณต์ก๋ ๋ฐ ๊ณต๊ฐ๋ณต์ก๋
์๊ณ ๋ฆฌ์ฆ | ์๊ฐ๋ณต์ก๋ | ๊ณต๊ฐ๋ณต์ก๋ | ||
---|---|---|---|---|
Best | Average | Worst | Worst | |
Quicksort | O(n log(n)) |
O(n log(n)) |
O(n^2) |
O(log(n)) |
Mergesort | O(n log(n)) |
O(n log(n)) |
O(n log(n)) |
O(n) |
Timsort | O(n) |
O(n log(n)) |
O(n log(n)) |
O(n) |
Heapsort | O(n log(n)) |
O(n log(n)) |
O(n log(n)) |
O(1) |
Bubble Sort | O(n) |
O(n^2) |
O(n^2) |
O(1) |
Insertion Sort | O(n) |
O(n^2) |
O(n^2) |
O(1) |
Selection Sort | O(n^2) |
O(n^2) |
O(n^2) |
O(1) |
Shell Sort | O(n) |
O((nlog(n))^2) |
O((nlog(n))^2) |
O(1) |
Bucket Sort | O(n+k) |
O(n+k) |
O(n^2) |
O(n) |
Radix Sort | O(nk) |
O(nk) |
O(nk) |
O(n+k) |
Graph Operations
Node / Edge Management | Storage | Add Vertex | Add Edge | Remove Vertex | Remove Edge | Query |
---|---|---|---|---|---|---|
Adjacency list | O(|V|+|E|) |
O(1) |
O(1) |
O(|V| + |E|) |
O(|E|) |
O(|V|) |
Incidence list | O(|V|+|E|) |
O(1) |
O(1) |
O(|E|) |
O(|E|) |
O(|E|) |
Adjacency matrix | O(|V|^2) |
O(|V|^2) |
O(1) |
O(|V|^2) |
O(1) |
O(1) |
Incidence matrix | O(|V| ⋅ |E|) |
O(|V| ⋅ |E|) |
O(|V| ⋅ |E|) |
O(|V| ⋅ |E|) |
O(|V| ⋅ |E|) |
O(|E|) |
Heap Operations
Type | ์๊ฐ๋ณต์ก๋ | ||||||
---|---|---|---|---|---|---|---|
Heapify | Find Max | Extract Max | Increase Key | Insert | 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 Heap | O(n) |
O(1) |
O(log(n)) |
O(log(n)) |
O(log(n)) |
O(log(n)) |
O(m+n) |
Binomial Heap | - |
O(1) |
O(log(n)) |
O(log(n)) |
O(1) |
O(log(n)) |
O(log(n)) |
Fibonacci Heap | - |
O(1) |
O(log(n)) |
O(1) |
O(1) |
O(log(n)) |
O(1) |
'๐ป Programming' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Spring Error] No converter found for return value of type: class java.util.ArrayList (0) | 2016.11.27 |
---|---|
์๋์ฐ์์ Docker๋ก PostgreSQL ๋์ฐ๊ธฐ (0) | 2016.11.24 |
[Redis] ๋ ๋์ค ๋ฐ์ดํ ํ์ ๋ณ ๋ช ๋ น์ด #1 - String ํธ (0) | 2016.06.18 |
[Redis] ๋ ๋์ค ํค์ ๊ด๋ จ ๋ช ๋ น์ด (0) | 2016.06.18 |
[Redis] ๋ ๋์ค ๋ฐ์ดํ ํ์ ์ ์ข ๋ฅ, ์์ ๋ฐ ์์ฝ ์ค๋ช (0) | 2016.06.18 |