11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

454 Chap. 13 Advanced Tree <strong>Structures</strong>d<strong>at</strong>a structure for storing such d<strong>at</strong>a is the R-tree, which was originally proposed byGuttman [Gut84].13.5 Exercises13.1 Show the binary trie (as illustr<strong>at</strong>ed by Figure 13.1) for the following collectionof values: 42, 12, 100, 10, 50, 31, 7, 11, 99.13.2 Show the PAT trie (as illustr<strong>at</strong>ed by Figure 13.3) for the following collectionof values: 42, 12, 100, 10, 50, 31, 7, 11, 99.13.3 Write the insertion routine for a binary trie as shown in Figure 13.1.13.4 Write the deletion routine for a binary trie as shown in Figure 13.1.13.5 (a) Show the result (including appropri<strong>at</strong>e rot<strong>at</strong>ions) of inserting the value39 into the AVL tree on the left in Figure 13.4.(b) Show the result (including appropri<strong>at</strong>e rot<strong>at</strong>ions) of inserting the value300 into the AVL tree on the left in Figure 13.4.(c) Show the result (including appropri<strong>at</strong>e rot<strong>at</strong>ions) of inserting the value50 into the AVL tree on the left in Figure 13.4.(d) Show the result (including appropri<strong>at</strong>e rot<strong>at</strong>ions) of inserting the value1 into the AVL tree on the left in Figure 13.4.13.6 Show the splay tree th<strong>at</strong> results from searching for value 75 in the splay treeof Figure 13.10(d).13.7 Show the splay tree th<strong>at</strong> results from searching for value 18 in the splay treeof Figure 13.10(d).13.8 Some applic<strong>at</strong>ions do not permit storing two records with duplic<strong>at</strong>e key values.In such a case, an <strong>at</strong>tempt to insert a duplic<strong>at</strong>e-keyed record into a treestructure such as a splay tree should result in a failure on insert. Wh<strong>at</strong> isthe appropri<strong>at</strong>e action to take in a splay tree implement<strong>at</strong>ion when the insertroutine is called with a duplic<strong>at</strong>e-keyed record?13.9 Show the result of deleting point A from the k-d tree of Figure 13.11.13.10 (a) Show the result of building a k-d tree from the following points (insertedin the order given). A (20, 20), B (10, 30), C (25, 50), D (35,25), E (30, 45), F (30, 35), G (55, 40), H (45, 35), I (50, 30).(b) Show the result of deleting point A from the tree you built in part (a).13.11 (a) Show the result of deleting F from the PR quadtree of Figure 13.16.(b) Show the result of deleting records E <strong>and</strong> F from the PR quadtree ofFigure 13.16.13.12 (a) Show the result of building a PR quadtree from the following points(inserted in the order given). Assume the tree is representing a space of64 by 64 units. A (20, 20), B (10, 30), C (25, 50), D (35, 25), E (30,45), F (30, 35), G (45, 25), H (45, 30), I (50, 30).(b) Show the result of deleting point C from the tree you built in part (a).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!