Review - Trees

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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Q3. Write a routine to list out the nodes of a binary
Background image of page 2
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

This note was uploaded on 12/28/2010 for the course CSC CSC1110 taught by Professor Cjyuan during the Fall '06 term at CUHK.

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 Right Arrow Icon
Ask a homework question - tutors are online