CSCA67H3 Lecture Notes - Tachykinin Receptor 1, If And Only If, Binary Logarithm

92 views27 pages
17 Apr 2011
School
Course
whitewalnut0803 and 38507 others unlocked
CSCA67H3 Full Course Notes
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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions