cs631hw10asolutions

cs631hw10asolutions - CS631 Homework 10a (binary trees)...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CS631 Homework 10a (binary trees) solutions Page 590, #2a pre, in and postorder traversals of tree in figure 11-44 Pre: MGDAHKLTRVUW In: ADHEKLMTRUVW Post: AHDLKGUVRWTM Page 590, #3 Given the tree in figure 11-45: a. Which node must have the inorder successor of the root? Right, then left until null – node #6 b. Give an inorder traversal of this tree (they’ve tried to make it difficult by numbering in level order). The traversal: 425616937 Page 590, #4 What binary trees are formed given insertions in these orders? a. WTNJEBA Lop-sided b. WTNABEJ Still lop-sided and O(N) for search c. ABWJNTE Page 590, #6 Arrange A,C,E,F,L,V and Z into two trees, one with max and one with min height. Page 590, #7 Considering the binary tree in figure 11.42. a. What tree results from inserting 80, 65, 75, 45, 35 and 25, in that order? b. What happens to the resulting tree after deleting 50 and 20? 50 is just a leaf and deleted, while 20 is an internal node and we need to get the inorder predecessor or successor. The successor is a better choice in internal node and we need to get the inorder predecessor or successor....
View Full Document

This note was uploaded on 10/21/2009 for the course CS CS 631 taught by Professor Dr.rogerd.eastman during the Spring '09 term at Loyola Maryland.

Page1 / 3

cs631hw10asolutions - CS631 Homework 10a (binary trees)...

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