Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
8 Cards in this Set
- Front
- Back
Bubble Sort - Complexity
|
Worst: O(n²)
Best: O(n) |
|
Bubble Sort implementation
|
procedure bubbleSort( A : list of sortable items )
n := length(A)-1 for(i=0; i<= n; i++) for(j=n; j>i; j--) if A[j-1] > A[j] then swap (A[j-1], A[j]) end if end for end for end procedure |
|
Merge Sort - Complexity
|
O(n log n)
|
|
Merge Sort description
|
split the list into two parts
merge sort left merge sort right merge left and right |
|
Quick Sort - complexity
|
Avg: O(n log n)
Wst: O(n²) |
|
Quick Sort - overall
|
if first < last
splitPoint = split array quick sort: first -> splitPoint - 1 quick sort: splitPoint + 1 -> last |
|
Quick Sort - split
|
sp = some split value
while first <= last do first++ until first > sp last++ until last < sp if first < last( swap first last first++ last++ ) end while swap savedFirst, last |
|
Binary Search Tree - node
|
left
right data |