{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Review - Trees

# Review - Trees - tree in level-order List the root then...

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

1 Review #2 - Trees (binary, AVL, B-tree) Q1. (a) Show that in a binary tree of N nodes, there are N+1 NULL pointers representing children. (b) Show that the maximum number of nodes in a binary tree of height H is 2 H+1 -1. Q2. (a) Show the result of inserting 3, 1, 4, 6, 9, 2, 5, 7 into an initially empty binary search tree. (b) Show the result of deleting the root.

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

View Full Document
2 Q3. Write a routine to list out the nodes of a binary
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tree in level-order. List the root, then nodes at depth 1, followed by nodes at depth 2, and so on. You must do this in linear time. Prove your time bound. Q4. (a) Show the result of inserting the following keys into an initially empty 2-3 tree: 3, 1, 4, 5, 9, 2, 6, 8, 7, 0. (b) Show the result of deleting 0 and then 9 from the 2-3 tree created in part (a)....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Review - Trees - tree in level-order List the root then...

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

View Full Document
Ask a homework question - tutors are online