04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

68<br />

Chapter 2 Basics of <strong>Algorithm</strong> Analysis<br />

~ gl(a) = 2 ~°4i~<br />

" g2(n) = 2 n<br />

i g4(n) ---- n4/3<br />

g3(n) = n(log n) 3<br />

gs(n) = nlog n<br />

g6(n) = 2 2n<br />

i gT(n) = 2 n2<br />

Assume you have functions f and g such that f(n) is O(g(n)). For each of<br />

the following statements, decide whether you think it is true or false and<br />

give a proof or counterexample.<br />

(a) log 2 f(n)’is O(log 2g(n))-<br />

(b) 2 f(n) is O(2g(~)).<br />

(C) /(n) 2 iS O(g(n)2).<br />

Consider the following basic problem. You’re given an array A consisting<br />

A[n]. You’d like to output a two-dimensional<br />

n-by-n array B in which B[i,j] (for i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!