Data Structures Demystified (Demystified)
1. | What is hashing? | |
2. | Why is it necessary to hash? | |
3. | What is a hashtable? | |
4. | What is the result of hashing? | |
5. | How is a key hashed ? | |
6. | Can a key entered by an application be directly compared to a key in a hashtable? | |
7. | What programming technique is used for hashing in all hashing functions? | |
8. | Why are data members of the Hashtable class stored in the private access specifier ? | |
9. | At what level is hashing performed? | |
10. | Is there one hashing function used in all applications for hashing? | |
Answers
1. | Hashing is the technique of scrambling bits of a key into a hash number. |
2. | Hashing assures that the format of keys is uniform and unique. |
3. | A hashtable is a table in which each entry consists of a hashed key and a value; the hashed key retrieves entries. |
4. | Hashing results in a hash number that has no real significance beyond it being used as the key for an entry. |
5. | A hash key is created by bit shifting a hashed value and then adding to the value bits of a character of the key entered by the application. |
6. | No. A key entered by the application must be hashed before it can be compared to a key in the hashtable. |
7. | Bit shifting is the common programming technique used for hashing in all hashing functions. |
8. | Data members of the Hashtable class are stored in the private access specifier to ensure the integrity of the data. Only member functions can assign and retrieve values of these data members. |
9. | Hashing occurs at the bit level. |
10. | There isn t one hashing function that s used in all applications for hashing. Developers test a wide variety of hashing functions before determining the best to use on a particular dataset. |
Категории