hw1_sol - CSC 316 Data Structures Homework 1 Solution -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 316 Data Structures Homework 1 Solution —– Provided by: Hui Wang 1. (a) n 2 = O ( n 2 + 1) Take c=1, n 0 = 1, then for any n n 0 , n 2 c · ( n 2 + 1). By definition, we have n 2 = O ( n 2 + 1). (b) n 2 = O (2 n 2 ) Take c=1, n 0 = 1, then for any n n 0 , n 2 c · (2 n 2 ). By definition, we have n 2 = O (2 n 2 ). (c) n i =1 i k = O ( n k +1 ) n i =1 i k n i =1 n k , since i n , for n 1. Take c=1, n 0 = 1. (d) n 2 = Θ( n 2 - 1) First show n 2 = O ( n 2 - 1), then show n 2 = Ω( n 2 - 1). Take c=2, n 0 = 1, then for any n n 0 , n 2 2 · ( n 2 - 1). Thus n 2 = O ( n 2 - 1). Take c=1, n 0 = 1, then for any n n 0 , n 2 1 · ( n 2 - 1). Thus, n 2 = Ω( n 2 - 1). (e) n 2 = Ω( n 2 - 1) when n 1 Please see the proof in the second part in d). 2. (a) f ( n ) = O ( g ( n )) implies g ( n ) = O ( f ( n )) False. Counter example: f ( n ) = n and g ( n ) = n 2 . (b)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2010 for the course CSC 316 taught by Professor Rhee during the Spring '08 term at N.C. State.

Page1 / 3

hw1_sol - CSC 316 Data Structures Homework 1 Solution -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online