Logarithm Rules and PropertiesSummations for PrintingSummation RulesDon`t panicInsertion Sort - Algorithm
Starting from one end, ensure the sub-array sorted in each pivot Selection sort - Algorithm
Starting from one end, ensure the sub-array sorted in each pivot Bubble sort - Algorithm
Binary comparison and swap, shift each pivot by at most 1 position in an iteration |
Sorting Complexities
Asymptotic Notations
Big-O Complexity ChartQueue ADT
Priority Queue ADT
Stack ADT
d-Heap ADT
(Min) Heap Tree - ADT
Binary Heap Operations Complexity: Heapify - O(n) Find Min - O(1) Insert - O(log(n)) Delete - O(log(n)) |
Loop -> (Tail) Recursion
Equivalent for loop: for (int i=0; i<n; i++) doFoo(i); Tail Recursion -> Iteration
Recurrence Simplification Strategy
e.g. T[n <= n0] = C1 T[n]= T[n/2]+C2 -> T[n] = T[n*(1/2)]+C2 -> T[n] = T[n*(1/2)^k] + k*C2 Let n*(1/2)^k <= n0 -> T(n*(1/2)^k) = C1 -> n*(1/2)^k * (2)^k <= n0* (2)^k -> n/n0 <= (2)^k -> log2(n/n0) <= log2((2)^k) -> log2(n/n0) <= k -> T[n] = C1+k*C2 = C1 + C2*log2(n/n0) Summation Fomulas |
Cheatography
https://cheatography.com
CPSC221MT Cheat Sheet by cddc
Cheatsheet for CPSC221 midterm (UBC 2016)
Created By
codenut.weebly.com
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets