CSCA67H3 Lecture Notes - Tachykinin Receptor 1, If And Only If, Binary Logarithm
whitewalnut0803 and 38507 others unlocked
6
CSCA67H3 Full Course Notes
Verified Note
6 documents
Document Summary
We have to consider all possible inputs of size n. We want the maximum number of steps that an input will force. Note: no input can take more steps than the upper bound, a lower bound cannot take less steps than any input. Show that in the worst case, is(n) will take at least f (n) steps. Is (int[] a){ int i = 1 while (i < a. length()){ t = a[i]; int j = i; while (j > 0 && a[j-1] > t){ // 7: >1 step step step step step step step. An array a of length n sorted in decreasing order, ie, {n 1, n . A[0m] after outer loop inner loop steps n-1 n-2,n-1 n-3,n-2,n-1 n-4,n-3,n-2,n-1 n-k-1, n-k, n-k+1, . 5 www. notesolution. com: at least how many steps does is(a) take? sum the above lines adding 5 per outer loop iteration. i 3 + 1 = 3 n 1.