Arjun Suresh (talk | contribs) |
Arjun Suresh (talk | contribs) |
||
Line 8: | Line 8: | ||
|Bubble | |Bubble | ||
|$\theta(n^{2})$ | |$\theta(n^{2})$ | ||
− | | | + | |$\theta(n^{2})$ |
− | | | + | |$\theta(n^{2})$ |
|- | |- | ||
|Selection | |Selection | ||
− | | | + | |$\theta(n^{2})$ |
− | | | + | |$\theta(n^{2})$ |
− | | | + | |$\theta(n^{2})$ |
|- | |- | ||
|Insertion | |Insertion | ||
− | | | + | |$\theta(n^{2})$ |
− | | | + | |$\theta(n^{2})$ |
− | | | + | |$\theta(n)$ |
|- | |- | ||
|Merge | |Merge | ||
− | | | + | |$\theta(nlgn)$ |
− | | | + | |$\theta(nlgn)$ |
− | | | + | |$\theta(nlgn)$ |
|- | |- | ||
|Quick | |Quick | ||
− | | | + | |$\theta(n^{2})$ |
− | | | + | |$\theta(nlgn)$ |
− | | | + | |$\theta(nlgn)$ |
|- | |- | ||
|Heap | |Heap | ||
− | | | + | |$\theta(nlgn)$ |
− | | | + | |$\theta(nlgn)$ |
− | | | + | |$\theta(nlgn)$ |
|} | |} | ||
[[Category: CS Notes]] | [[Category: CS Notes]] | ||
[[Category: Algorithms & Data Structures]] | [[Category: Algorithms & Data Structures]] |
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)$ |
Algorithm | Worst Case | Average Case | Best Case |
---|---|---|---|
Bubble | $\theta(n^{2})$ | 7.00 | 7.00 |
Selection | 4 | 3.00 | 3.00 |
Insertion | 1 | 5.00 | 5.00 |
Merge | 1 | 5.00 | 5.00 |
Quick | 1 | 5.00 | 5.00 |
Heap | 1 | 5.00 | 5.00 |