Part I: written exercises

1. See the steps of inserting 50, 87, 50, 26, 52, 55, 13, 16, 28, 11, 20, 30 into a red- black tree. Draw the trees after you inserting each value, use the color change or rotations to fix the error if there is any. (for each new inserted value, draw the corresponding tree, you can use the applet to take the screenshots, however, the applet may not be correct even it shows Red-Black correct).

2. Given input {3823, 8806, 8783, 2850, 3593, 8479, 1941, 4290, 8818, 7413, 1729} and a hash function h(x) = x %10 (table size is 10), showing the resulting. Rehashing is NOT considered here.

a. Separate chaining hash table
b. Open addressing hash table using linear probing.
c. Open addressing hash table using quadratic probing.
d. Open addressing hash table with second hash function h2(x) = 7 - (x % 7)

3. Using the diagrams (like in handouts 50-54) to trace the action of heapsort on the list of 6, 10, 1, 4, 7, 9, 3, 2, 8, 11, give every state of your tree such as finishing a heapify or removing the root.

Part II: programming exercise

Implement a linear probe hash table that stores strings. You'll need a hash function that converts a string to an index number; see the section "Hashing Strings" in this chapter. Assume the strings will be lowercase words, so 26 characters will suffice.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.