Arjun Suresh (talk | contribs) |
Arjun Suresh (talk | contribs) |
||
Line 21: | Line 21: | ||
|$\theta(n)$ | |$\theta(n)$ | ||
|- | |- | ||
− | | | + | |Quick |
+ | |$\theta(n^{2})$ | ||
|$\theta(nlgn)$ | |$\theta(nlgn)$ | ||
|$\theta(nlgn)$ | |$\theta(nlgn)$ | ||
+ | |- | ||
+ | |Merge | ||
|$\theta(nlgn)$ | |$\theta(nlgn)$ | ||
− | |||
− | |||
− | |||
|$\theta(nlgn)$ | |$\theta(nlgn)$ | ||
|$\theta(nlgn)$ | |$\theta(nlgn)$ |
Algorithm | Worst Case | Average Case | Best Case |
---|---|---|---|
Bubble | $\theta(n^{2})$ | $\theta(n^{2})$ | $\theta(n^{2})$ |
Selection | $\theta(n^{2})$ | $\theta(n^{2})$ | $\theta(n^{2})$ |
Insertion | $\theta(n^{2})$ | $\theta(n^{2})$ | $\theta(n)$ |
Quick | $\theta(n^{2})$ | $\theta(nlgn)$ | $\theta(nlgn)$ |
Merge | $\theta(nlgn)$ | $\theta(nlgn)$ | $\theta(nlgn)$ |
Heap | $\theta(nlgn)$ | $\theta(nlgn)$ | $\theta(nlgn)$ |
Algorithm | Worst Case | Average Case | Best Case |
---|---|---|---|
Bubble | $\theta(n^{2})$ | $\theta(n^{2})$ | $\theta(n^{2})$ |
Selection | $\theta(n^{2})$ | $\theta(n^{2})$ | $\theta(n^{2})$ |
Insertion | $\theta(n^{2})$ | $\theta(n^{2})$ | $\theta(n)$ |
Merge | $\theta(nlgn)$ | $\theta(nlgn)$ | $\theta(nlgn)$ |
Quick | $\theta(n^{2})$ | $\theta(nlgn)$ | $\theta(nlgn)$ |
Heap | $\theta(nlgn)$ | $\theta(nlgn)$ | $\theta(nlgn)$ |