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})$ | $\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)$ |