Computer Science, asked by prachi657335, 5 days ago

Hashtables #1 See this implementation of a hash function. It will be used for putting C-style null-terminated char * strings in a hashtable: int hash (char *str) { return strlen(str); /* return Length of string */ } Which of the following statements are true? Pick all that apply This is an invalid hash function, because hash function should return a bitmap This is a good hash function because it returns different values for different strings This is a bad hash function because it returns the same value for all strings of the same length. This will cause the hashtable implementation to crash because it can return the same hash value for different strings This will cause the hashtable implementation to be inefficient because it will cause the same hash value to be returned for many different strings​

Answers

Answered by palani6162
9

in this answer guys plz give me five star

Attachments:
Answered by shilpa85475
6

The statements are false.

Explanation:

  • Hashtable is implemented in Dictionary.  Like HashMap,
  • It stores the key value pairs in a hash table.
  • When one is using a Hashtable, one can specify an object that is used as a key, and the value that is linked to the value.
  • But the HashMap is non-synchronized.
  • The Hashtable is synchronized.
  • HashMap allows one null key and multiple null values.
  • Hashtable doesn't allow any null key or value.

Similar questions