for (int i = 0 ; i < n ; i++)
for (int j = 0; j < i; j++)
x = i + j;
How often is the j<i comparison performed? How often is the i<n comparison performed? How often is the addition statement performed?
mScript_T(T::T()) + min(m,n)*Script_T(T::T(T&)) + n Script_T(T::~T()) + O(1)
Insertion into an empty list. Insertion at the start of a (non-empty) list. Insertion at the tail. Deletion from and empty list? Deletion from at the head of the list. Deletion from the tail
| Function | Ordered List as Array | Ordered List as LinkedList |
| Insert | ||
| IsMember | ||
| Withdraw | ||
| Insert After/Before ... |
| Function | Array Implementation | Linked List Implementation |
| Insert | ||
| IsMember | ||
| Find ... etc. |
| n | l (n/M) | U(n)= 1/(1-l) |
| 0 | 0 | 1 |
| 1 | 1/23 | 23/22 |
| 2 | 2/23 | 23/21 |
| 3 | 3/23 | 23/20 |
| Technique | Best Case | Worst Case | Average Case |
| Straight Insertion | |||
| Binary Insertion | |||
| Bubble | |||
| Quicksort | |||
| Straight Selection | |||
| Heapsort | |||
| Merge Sort | |||
| Radix Sort |