3Algorithm Analysis3.1Note thatnis a positive integer.5nlognis most effcient forn=1.2nis most effcient when2≤n≤4.10nis most effcient for alln>5.20nand2nare never moreeffcient than the other choices.3.2Bothlog3nandlog2nwill have value0whenn.Otherwise, 2 is the most effcient expression for all1.3.32log3nlog2nn2/320n4n23nn!.3.4(a)n+6inputs (an additive amount, independent ofn).(b)8ninputs (a multiplicative factor).(c)64ninputs.3.5100n.10n.About4.6n(actually,3√100n).n.3.6(a)These questions are quite hard. Iff(n)=2n=x, thenf(2n2n=(2n)2=x2.(b)The answer is2(nlog23). Extending from part (a), we need some way tomake the growth rate even higher. In particular, we seek some way to
This is the end of the preview. Sign up
access the rest of the document.