{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm2_Solution

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

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

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

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

View Full Document
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?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online