SolHW8f07 - HW8F07 CS336 1 Prove or disprove that if f is Θ g and s 6 = 0 is a constant then sf is Θ g Solution Since f = Θ g there exist C 1,C

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: HW8F07 CS336 1. Prove or disprove that if f is Θ( g ) and s 6 = 0 is a constant then sf is Θ( g ). Solution: Since f = Θ( g ), there exist C 1 ,C 2 ,k such that C 1 | g ( x ) | ≤ | f ( x ) | ≤ C 2 | g ( x ) | , ∀ x ≥ k If | s | ≥ 1, Let C 2 = | s | · C 2 . Then C 1 | g ( x ) | ≤ | f ( x ) | ≤ | s |·| f ( x ) | = | s · f ( x ) | ≤ | s | C 2 | g ( x ) | = C 2 | g ( x ) | , ∀ x ≥ k If | s | < 1, Let C 1 = | s | · C 1 . Then C 1 | g ( x ) | ≤ | s | · C 1 | g ( x ) | ≤ | s | · | f ( x ) | = | s · f ( x ) | ≤ C 2 | g ( x ) | , ∀ x ≥ k 2. Give a big- O estimate for ( n +3 n 2 )(log n !+2 n +log n 3 ). For your estimate, use the simplest function of the smallest order. Solution: O ( n 2 · 2 n ) 3. Prove that every nonempty, full binary tree has an odd number of nodes. Recall, with our definition, that a full tree is one in which every node has either 0 or 2 children. Solution: We will prove this by induction on the height of the tree. For the base case, we have h = 0 and t = ( d, ∅ , ∅ ). This tree has 1 node, which is an odd number. For the inductive step, the I.H. is the following: for full binary trees of height k ≤ h , the number of nodes is odd. We need to show that for a binary full tree of height h + 1, the number of nodes is odd....
View Full Document

This note was uploaded on 09/20/2008 for the course CS 336 taught by Professor Myers during the Spring '08 term at University of Texas at Austin.

Page1 / 4

SolHW8f07 - HW8F07 CS336 1 Prove or disprove that if f is Θ g and s 6 = 0 is a constant then sf is Θ g Solution Since f = Θ g there exist C 1,C

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