CS 334: Written Assignment #2

Note to self: there are a number of improvements that could be made to these questions next time, see file written2updates.txt in assignments.

Hand in your answers to the following textbook exercises. The variations and clarifications you find below are in response to student questions in the past.

Variation on problem 8.4. Consider the instance of the Students relation shown in Figure 8.6 on page 301. Suppose that it is given that you must have all the records in the file sorted by age. Perhaps you know that you will be scanning all records, in age order, on a regular basis. Perhaps it is just a silly constraint of this problem. Whatever the reason, you must at least allow all records to be sorted by age. You can allow some blank space between the records if you like. With all of that said, for exercise 8.4 parts 1-12, explain what the data entries in each of the following indexes contains. If the order of entries is significant, say so and explain why. If such an index cannot be constructed, say so and explain why. If the answer is dependent on the kind of index (tree vs. hash, for example), say so and explain why.

Problem 8.10.

Problem 10.2. For parts 2 and 3 of this problem, make sure to actually draw the relevant portions of the tree. For part 6 of this problem, you should re-answer each of parts 1-5.

Problem 10.9.

Problem 11.1. For part 1, assume that the very last entry that was inserted was not immediately deleted. You may still assume that prior entries have been deleted, however.

Problem 11.2. For part 1, assume that the very last entry that was inserted was not immediately deleted. You may still assume that prior entries have been deleted, however.

Problem 11.4.

Problem 11.9.