Question: DO BOTH QUESTION PLEASE THABKYOU ANSWER NEEDED QUICKLY XX Question #6: Write a function named mirror() that takes a reference to the root node of
DO BOTH QUESTION PLEASE THABKYOU ANSWER NEEDED QUICKLY XX
Question #6: Write a function named mirror() that takes a reference to the root node of a binary tree and creates a new tree (with its own nodes) that is the mirror image of the original tree. For example: if root is a reference to the root of the tree on the left below, then the return value of mirror(root) would be a reference to the root of the tree on the right below. 1 1 / 4 5 5 4 1 7 6 Question #7: a) Consider a hash table with separate chaining with ten hash locations. Using the hash function h(x) = x mod 10, insert the keys {33, 54,69,74, 18, 19} (in the order given) into the hash table. Draw the resulting hash table. (Note: to keep this example simple, we use table size that is not prime.) b) Consider an open addressing hash/scatter table with ten slots. For the hash function h(x) = x mod 10, insert the keys {33, 54,69,74, 18, 19) (in the order given) into the table. Use linear probing for collision resolution. Show the result in the table (b) below: 0 0 1 1 2 3 2 3 4 5 6 7 4 5 6 7 8 8 9 9 (a) (b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
