Skip to content

Commit

Permalink
added sorting algorithm complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganbayar Gansukh committed Jul 16, 2021
1 parent 5f1bfe2 commit 6509531
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions algorithms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

## Sorting algorithm complexity
---

| algorithm | time complexity (best, avg, worst) | space | stable |
|---|---|---|---|
| selection | n^2   n^2   n^2 | constant | false
| bubble | n   n^2   n^2 | constant | true
| insertion | n   n^2   n^2 | constant | true
| heap | nlogn   nlogn   nlogn | constant | false
| quick | nlogn   nlogn   n^2 | constant | false
| merge | nlogn   nlogn   nlogn | n | true
| bucket | n + k   n + k   n + k | nk
| radix | nk   nk   nk

0 comments on commit 6509531

Please sign in to comment.