CommonExam2ans

CommonExam2ans - CS 114 Common Exam 2 Answers Fall 2008 For...

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

View Full Document Right Arrow Icon
CS 114 Common Exam 2 Fall 2008 Answers For each of the trees below, circle all descriptions that apply: (assume heap stores largest value at the root) 1) a)full b)complete c)search tree d)heap e)balanced 5 points for problems 1 to 3 2) a)full b)complete c)search tree d)heap e)balanced 3) a)full b)complete c)search tree d)heap e)balanced Page 1 of 9 60 20 50 10 80 20 90 10 50 90 40 80 10 30 70 90 30
Background image of page 1

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

View Full DocumentRight Arrow Icon
4) Using the tree from problem 3, write all the nodes using: 6 points a) preorder traversal 90 40 10 30 80 70 90 c) postorder traversal 10 30 40 70 90 80 90 5) Draw the binary search tree that results from entering numbers in the following order: 60 10 20 90 30 80 70 6 points 60 10 90 20 80 30 70 Page 2 of 9
Background image of page 2
6) Delete 40 from the BST below: 6 points Only need to draw the last tree, this is the final answer. Page 3 of 9 20 80 10 30 60 90 35 70 40 20 80 10 30 X 90 35 70 60 20 80 10 30 70 90 35 60
Background image of page 3

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

View Full DocumentRight Arrow Icon
Using the 2-3-4 tree: 7 points Insert the value 52 and draw the resulting tree below: Answer: Page 4 of 9 25 50 10 37 45 55 30 15 20 40 80 65 90 70 35 32 60 62 25 50 10 37 45 55 30 15 20 40 80 65 90 70 35 32 60 62 52
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 09/21/2009.

Page1 / 9

CommonExam2ans - CS 114 Common Exam 2 Answers Fall 2008 For...

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

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