Question: 11. Given two sets A and B represented as sorted sequences, describe an efficient algorithm for computing AeB, which is the set of elements that

 11. Given two sets A and B represented as sorted sequences,

11. Given two sets A and B represented as sorted sequences, describe an efficient algorithm for computing AeB, which is the set of elements that are in A or B, but not in both. 12. Let S be a random permutation of n distinct integers. Argue that the expected running time of insertion-sort on s is (n2). (Hint: Note that half of the elements ranked in the top half of a sorted version of S are expected to be in the first half of S.) 13. Come up a compression map (function) that results in no collisions for the following data for a 7-entry hash table: 55, 45, 12, 1,4, 23, 7. Draw the resulting hash table. 14. Draw the 7-entry hash table that results from hash function, h(i) = (21+5)%7, to hash the keys 12, 34, 13, 78, 21, 91, 11, 39, 10, 6, and 15, assuming collisions are handled by chaining 15. Does a preorder traversal of a heap list its keys in non-decreasing order? Argue that it is right or give a counterexample to disprove

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!