File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,13 +217,13 @@ Below is the list of some of the most used Big O notations and their performance
217217
218218### Array Sorting Algorithms Complexity
219219
220- | Name | Best | Average | Worst | Memory | Stable |
221- | --------------------- | :-------: | :-------: | :-----------: | :-------: | :-------: |
222- | ** Bubble sort** | n | n^2 | n^2 | 1 | Yes |
223- | ** Insertion sort** | n | n^2 | n^2 | 1 | Yes |
224- | ** Selection sort** | n^2 | n^2 | n^2 | 1 | No |
225- | ** Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No |
226- | ** Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes |
227- | ** Quick sort** | n log(n) | n log(n) | n^2 | log(n) | No |
228- | ** Shell sort** | n log(n) | depends on gap sequence | n (log(n))^2 | 1 | No |
229- | ** Counting sort** | n + r | n + r | n + r | n + r | Yes |
220+ | Name | Best | Average | Worst | Memory | Stable | Comments |
221+ | --------------------- | :-------: | :-------: | :-----------: | :-------: | :-------: | :-------- |
222+ | ** Bubble sort** | n | n^2 | n^2 | 1 | Yes | |
223+ | ** Insertion sort** | n | n^2 | n^2 | 1 | Yes | |
224+ | ** Selection sort** | n^2 | n^2 | n^2 | 1 | No | |
225+ | ** Heap sort** | n log(n) | n log(n) | n log(n) | 1 | No | |
226+ | ** Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes | |
227+ | ** Quick sort** | n log(n) | n log(n) | n^2 | log(n) | No | |
228+ | ** Shell sort** | n log(n) | depends on gap sequence | n (log(n))^2 | 1 | No | |
229+ | ** Counting sort** | n + r | n + r | n + r | n + r | Yes | r - biggest number in sorted array |
You can’t perform that action at this time.
0 commit comments