CS114FinalExamOld

CS114FinalExamOld - CS 114 Final Examamination Summer 2008...

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

View Full Document Right Arrow Icon
CS 114 Final Examamination Summer 2008 Name________________________________________________ 1) Fill in the nodes of the tree below with the values: 20 50 10 40 60 90 30 70 so that it will be a BST: Page 1 of 8
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) Using the same values as problem 1, construct a BST by inserting the numbers in the order listed. Page 2 of 8
Background image of page 2
3) Delete 70 from the BST below: draw tree with 70 deleted here: Page 3 of 8 40 20 80 10 30 60 90 50 70 75
Background image of page 3

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

View Full DocumentRight Arrow Icon
3) Using the tree from problem 3, write all the nodes using: a) preorder traversal b) postorder traversal 4) The numbers below represent a quicksort in progress. The last number is the pivot. The arrows point to the first pair of numbers that have been exchanged during the partition step. Perform the next exchange in the partition and fill in the numbers after the exchange with arrows pointing to the numbers you exchanged. fill in the array below: Page 4 of 8 40 5 5 15 60 35 10 85 70 25 80 1 65 5 50 65 5 50
Background image of page 4
Using the 2-3-4 tree: Insert the value 27 and draw the resulting tree. Page 5 of 8
Background image of page 5

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

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

Page1 / 8

CS114FinalExamOld - CS 114 Final Examamination Summer 2008...

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

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