Skip to content

Commit b65a992

Browse files
committed
Update READMEs.
1 parent e53f5f9 commit b65a992

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -215,28 +215,28 @@ Below is the list of some of the most used Big O notations and their performance
215215

216216
### Data Structure Operations Complexity
217217

218-
| Data Structure | Access | Search | Insertion | Deletion | Comments |
219-
| ----------------------- | :-------: | :-------: | :-------: | :-------: | :-------- |
220-
| **Array** | 1 | n | n | n | |
221-
| **Stack** | n | n | 1 | 1 | |
222-
| **Queue** | n | n | 1 | 1 | |
223-
| **Linked List** | n | n | 1 | 1 | |
224-
| **Hash Table** | - | n | n | n | In case of perfect hash function costs would be O(1) |
225-
| **Binary Search Tree** | n | n | n | n | In case of balanced tree costs would be O(log(n)) |
226-
| **B-Tree** | log(n) | log(n) | log(n) | log(n) | |
227-
| **Red-Black Tree** | log(n) | log(n) | log(n) | log(n) | |
228-
| **AVL Tree** | log(n) | log(n) | log(n) | log(n) | |
218+
| Data Structure | Access | Search | Insertion | Deletion | Comments |
219+
| ----------------------- | :---------: | :---------: | :---------: | :---------: | :-------- |
220+
| **Array** | `1` | `n` | `n` | `n` | |
221+
| **Stack** | `n` | `n` | `1` | `1` | |
222+
| **Queue** | `n` | `n` | `1` | `1` | |
223+
| **Linked List** | `n` | `n` | `1` | `1` | |
224+
| **Hash Table** | - | `n` | `n` | `n` | In case of perfect hash function costs would be `O(1)` |
225+
| **Binary Search Tree** | `n` | `n` | `n` | `n` | In case of balanced tree costs would be `O(log(n))` |
226+
| **B-Tree** | `log(n)` | `log(n)` | `log(n)` | `log(n)` | |
227+
| **Red-Black Tree** | `log(n)` | `log(n)` | `log(n)` | `log(n)` | |
228+
| **AVL Tree** | `log(n)` | `log(n)` | `log(n)` | `log(n)` | |
229229

230230
### Array Sorting Algorithms Complexity
231231

232-
| Name | Best | Average | Worst | Memory | Stable | Comments |
233-
| --------------------- | :-------: | :-------: | :-----------: | :-------: | :-------: | :-------- |
234-
| **Bubble sort** | n | n^2 | n^2 | 1 | Yes | |
235-
| **Insertion sort** | n | n^2 | n^2 | 1 | Yes | |
236-
| **Selection sort** | n^2 | n^2 | n^2 | 1 | No | |
237-
| **Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No | |
238-
| **Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes | |
239-
| **Quick sort** | n log(n) | n log(n) | n^2 | log(n) | No | |
240-
| **Shell sort** | n log(n) | depends on gap sequence | n (log(n))^2 | 1 | No | |
241-
| **Counting sort** | n + r | n + r | n + r | n + r | Yes | r - biggest number in array |
242-
| **Radix sort** | n * k | n * k | n * k | n + k | Yes | k - length of longest key |
232+
| Name | Best | Average | Worst | Memory | Stable | Comments |
233+
| --------------------- | :---------: | :---------: | :-------------: | :---------: | :-------: | :-------- |
234+
| **Bubble sort** | `n` | `n^2` | `n^2` | `1` | Yes | |
235+
| **Insertion sort** | `n ` | `n^2` | `n^2` | `1` | Yes | |
236+
| **Selection sort** | `n^2` | `n^2` | `n^2` | `1` | No | |
237+
| **Heap sort** | `n log(n)` | `n log(n)` | `n log(n)` | `1` | No | |
238+
| **Merge sort** | `n log(n)` | `n log(n)` | `n log(n)` | `n` | Yes | |
239+
| **Quick sort** | `n log(n)` | `n log(n)` | `n^2` | `log(n)` | No | |
240+
| **Shell sort** | `n log(n)` | depends on gap sequence | `n (log(n))^2` | `1` | No | |
241+
| **Counting sort** | `n + r` | `n + r` | `n + r` | `n + r` | Yes | `r` - biggest number in array |
242+
| **Radix sort** | `n * k` | `n * k` | `n * k` | `n + k` | Yes | `k` - length of longest key |

src/algorithms/sorting/bubble-sort/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ are needed, which indicates that the list is sorted.
1111

1212
## Complexity
1313

14-
###### time: worst _O_(_n_<sup>2</sup>), best _O_(_n_), average _O_(_n_<sup>2</sup>)
14+
Time
1515

16-
###### space: worst _O_(1) auxiliary
16+
- worst _O_(_n_<sup>2</sup>),
17+
- best _O_(_n_),
18+
- average _O_(_n_<sup>2</sup>)
19+
20+
Space
21+
22+
worst _O_(1) auxiliary
1723

1824

1925
## References

0 commit comments

Comments
 (0)