1. False Linear probing is equivalent to double hashing with a secondary hashTru
ID: 3718689 • Letter: 1
Question
1. False Linear probing is equivalent to double hashing with a secondary hashTrue function of h2(k)-1 True False An algorithm with worst case time behavior of 3n takes at least 30 operations for eve ry input of size n-10 3. Building a heap from an array of N items requires O(N log N) time. True False 4. For large input sizes, merge sort will always run faster than insertion sort True False (on the same input) 5. It is possible for a member function of a class to activate another member True False function of the same class. 6. Friend functions of the class can access private member variables of a True False class. 7. Suppose that the bag is implemented with a linked list. The insertion True False operation is likely to have a constant worst-case time 8. When a function changes *p, and we want the change to affect the object True False that is pointed at. So we should set the pointer parameter p be a reference parameter 9. True False The implementation of copy constructor is the same as the implementation of an overloaded assignment operator 10. In the array version of the stack class (with a fixed-sized array), push True False operations require linear time at worst-case.Explanation / Answer
Answers)
1. Linear probing is equivalent to double hashing with a secondary hash function of h2(k) = 1. True False
Answer)
True. Linear probing is actually equivalent to the double hashing with a secondary hash function of h2(k) = 1, as it is equivalent to how the linear probing works.
2. An algorithm with worst case time behavior of 3n takes at least 30 operations for every input of size n=10 True False
Answer)
True. This is True as where size n=10, then the algorithm takes in worst case 30 operations or 3n.
3. Building a heap from an array of N items requires O(N log N) time. True False
Answer)
False. Building heap from array of N items requires O(N log N).
4. For large input sizes, merge sort will always run faster than insertion sort (on the same input). True False
Answer)
False. This is False as on the same input, merge sort will not run faster than the insertion sort for large input sizes.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.