Cost model. Number of array accesses.
Empirical result.
Warning: Numbers in the specific table below may be inaccurate and need to be updated, see [TODO]s in the corresponding Java classes.
Algorithm | Initialization | Union | Find |
---|---|---|---|
Quick Find (All Cases) | |||
Quick Union (Worst Case) |
Analysis. Quick-find, under all circumstances, is effective at Find method, but it doesn't perform well with Union. Quick-union on other hand CAN potentially be effective at Union, but it MAY not be working well with Find. However, in worst case, Quick-union performs worse than Quick-find even on Union.
Cost model. Number of array accesses & exchanges (i.e. swaps).
Empirical result.
Algorithm | No. of Array Accesses | No. of Exchanges |
---|---|---|
Selection Sort | ||
Best case |
|
|
Average case | ||
Worst case | ||
Insertion Sort | ||
Best case |
|
|
Average case | ||
Worst case |
Cost model. Number of array accesses & compares.
Empirical result.
Input Model | No. of Array Accesses | No. of Compares |
---|---|---|
Best case | ||
Average case | ||
Worst case |
Analysis. Merge sort uses at most