Give a True or False Collision resolution is the main contributor to the cost of
ID: 3768734 • Letter: G
Question
Give a True or False Collision resolution is the main contributor to the cost of hashing. In separate chaining, X has no maximum value .Any function can be a hash function if it produces an integer that is suitable to be used as an array index. Most hash tables are not full. Real-world data is uniformaly distributed. Using a hash table size that is a prime number distributes values through the index range better thatn if the size is an even number. In a sequential search of a sorted array, you must examine the entire array if an item is not present in the array. A binary search is usually slower than a sequential search on sorted array of data. Sorting data typically takes more time than searching it. What is X for a hash table with 500 locations and 200 entries that uses open addressing Explain why resizing a hash table that has 751 entries to double the size, or 1502, is a bad idea. Explain why a binary search implementation of a sorted chain is impractical.Explanation / Answer
A
B
C
D
E
F
G
H
I
T
T
T
T
F
T
T
F
11
Choosing between a sequential search and a binary search. You just saw that you should use asequential search to search a chain of linked nodes. But if you want to search an array of objects,you need to know which algorithms are applicable. To use a sequential search, the objects musthave a method equals that ascertains whether two distinct objects are equal in some sense. Sinceall objects inherit equals from the class Object, you must ensure that the objects you search have
overridden equals with an appropriate version. To perform a binary search on an array of objects,on the other hand, the objects must have a compareTo method and the array must be sorted. If theseconditions are not met, you must use a sequential search. If both search algorithms are applicable to your array, what search should you use? If the arrayis small, you can simply use a sequential search. If the array is large and already sorted, a binarysearch is typically much faster than a sequential search. But if the array is not sorted, should yousort it and then use a binary search? The answer depends on how often you plan to search the array.Sorting takes time, typically more time than a sequential search would. If you plan to search anunsorted array only a few times, sorting the array so that you can use a binary search likely will notsave you time; use a sequential search instead.
Only the sequential search is applicable to unsorted data. The efficiencies given for the binary
A
B
C
D
E
F
G
H
I
T
T
T
T
F
T
T
F
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.