hw04 - HW04 CSE 331 Section 1 Due Friday 8 Feb noon 1 Feb...

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

View Full Document Right Arrow Icon
HW04 CSE 331 Section 1 Due Friday 8 Feb noon 1 Feb version Remember to appropriately justify answers/reasoning. Also remember that this is individual work. 1) Problem 4.5 of the text: use mathematical induction to do the proof. Show that the maximum number of nodes in a binary tree of height h is 1 2 ) 1 ( - + h . 2) Relate this to problem 4.5 of the text. a) Compute the average depth of a node in a perfect binary tree of height h and n = 1 2 ) 1 ( - + h nodes (give a formula). (Give an exact answer for h = 4 .) b) What is the average case effort for a successful search in this tree? c) What is the worst case effort of a failed search in the tree? d) What is the average case effort of a failed search in this tree? Be more precise than Big Oh: Derive formulas in terms of h and n that are simple and also accurate to within 0.5 of the exact answer. In doing this, assume that the cost of finding the root key is 1, the cost of finding a key in the root’s children is 2, and the cost of finding a leaf node is h+1. Also, the cost of not finding a key in a leaf node is h+1.
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 07/25/2008 for the course CSE 331 taught by Professor M.mccullen during the Spring '08 term at Michigan State University.

Page1 / 2

hw04 - HW04 CSE 331 Section 1 Due Friday 8 Feb noon 1 Feb...

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