final - >makes it inapplicable to the practice exam...

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

View Full Document Right Arrow Icon
William Duncan <duncan@bit.csc.lsu.edu> 12/05/2004 08:51 PM To: "Erin Olander" <eoland1@paws.lsu.edu>, "CSC 1254 Fall 2004":; cc: bcc: Mariel Losso/mlosso1/LSU Subject: Re: cs1254 practice exam question Yes. The formulas I took of a book which assumes the height of the root is 0. See the revisions below. I should've tweak them but assume that you all wouldn't use formulas but simply draw the tree and derive the answers by induction. I thought I made this clarification in class during the review but apparently I didn't. So let me make it again just in case I didn't. At 08:34 PM 12/5/2004, you wrote: >So does this convention change any of the other formulas that you sent us, >because I'm looking at them and comparing them with some of the answers we >got in class for the practice exam, and they are not matching. For >example, on 1.D.c., we said in class that the answer was 20, but if I use >the formula you sent us, the answer is different. Here are the formulas >you sent us(#5 is used for the example I mention, unless the word "full"
Background image of page 1

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

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

Unformatted text preview: >makes it inapplicable to the practice exam question): > >1. To find the minimum height of a Binary Search Tree with n nodes ***-> ceiling[log_2(n+1)] - 1 >ex: ceiling[6.2] = 7 > >ceiling[9] = 9 >ceiling[0.1] = 1 > >ceiling is the smallest integer greater than a number. > >2. The height of a complete binary tree with n nodes is *** -> ceiling[log_2(n+1)] - 1 >3. The maximum number of comparison needed to search for a target in >a full binary search tree is log_2(n) where n is the number of nodes >in the tree. > >4. The maximum height that a binary tree can have if it has n nodes >is n-1. (The tree degenerates to a list). > >5. The maximum number of leaf nodes a binary tree can have if it >has a height of h is >*** -> 2^(h) >6. The maximum number of leaf nodes a binary tree can have if it >has a n nodes is 2^(log_2(n+1)-1) = (n+1)/2 > >I just want to make sure I do the right thing on the final. Sorry for all >the emails. Please let me know what is correct and what formulas I should >go by. > >Erin...
View Full Document

This note was uploaded on 01/17/2012 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Page1 / 2

final - >makes it inapplicable to the practice exam...

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