midterm2_Solution - COP-3530 DATA STRUCTURES AND ALGORITHMS...

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

View Full Document Right Arrow Icon
COP-3530 DATA STRUCTURES AND ALGORITHMS Instructor: Manuel Bermúdez Fall 2009 MIDTERM EXAM 2 Closed Books, Closed Notes, 50 Minutes Problem 1 _______ (20p.) Problem 2 _______ (20p.) Problem 3 _______ (20p.) Problem 4 _______ (20p.) Problem 5 _______ (20p.) SCORE _______ (100p.) UFID : Name : Note: Turn in your work on this exam only
Background image of page 1

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

View Full DocumentRight Arrow Icon
Problem 1. Recall that the degree of a node in a tree is defined as the number of its children, and the degree of a tree as the maximum degree of its children. Also recall that the height of a tree is the number of its levels (tree with just one node has height 1), or equivalently the length of the longest path starting from the root. Now consider a tree which has degree d, and height h. (a) What is the maximum number of nodes n this tree can have? (b) What is the minimum number of nodes n this tree can have? (c) Assuming this tree has n nodes, what is the minimum possible height (in terms of d and n) this tree can have? (d) If a binary tree has n leaves, how many internal nodes (non-leaves) does it have?
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2010 for the course COP 3530 taught by Professor Davis during the Fall '08 term at University of Florida.

Page1 / 11

midterm2_Solution - COP-3530 DATA STRUCTURES AND ALGORITHMS...

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

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