Suppose we wanted to use a hash table to store people’s names. Each name is a String object. What is wrong with using the length of the string as the hash value of each name?

What will be an ideal response?


Many names have the same length, so there would be many collisions.

Computer Science & Information Technology

You might also like to view...

Which statement below could be used to simulate the outputs of rolling a six-sided die? Suppose randomNumbers is a SecureRandom object.

a. 1 + randomNumbers.nextInt(6); b. 1 + randomNumbers.nextInt(2); c. 6 + randomNumbers.nextInt(1); d. 3 + randomNumbers.nextInt(3);

Computer Science & Information Technology

A(n) ________ is used to provide explanatory information about the macro or the action

A) condition B) command C) argument D) comment

Computer Science & Information Technology

Secure FTP (SFTP)

What will be an ideal response?

Computer Science & Information Technology

Alice’s Vehicle property lets us synchronize the movements of two objects.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology