NAMES:

LOGINS:

PRECEPTS:

COS 226 Exercises on Tries

References: Section 5.2 in Algorithms, 4th edition

1. Draw the R-way trie (in the same style as the diagram bottom right of p. 734) when you insert the following key-value pairs into an initially empty trie. Use the decimal alphabet (R = 10).

(351, A)  (652, B)  (893, C)  (353, D)  (352, E)  (622, F)  (3522, G)  (355, H)



















2. Draw the TST that results when you insert the following key-value pairs into an initially empty trie (in the order given). Draw all of the null links.

(351, A)  (652, B)  (893, C)  (353, D)  (352, E)  (622, F)  (3522, G)  (355, H)