InterviewSolution
Saved Bookmarks
| 1. |
What is the difference between array and hash table? |
|
Answer» An array has a SET NUMBER of memory regions at first. It should store a preset type at each site (e.g. an integer). It could have repeated values or not. Hash is implemented as a set, on the other HAND. It's built around an array. A hash function determines the position of an item in an array. There should be no duplicates in a hash. A collision occurs when duplicates occur, and there are several techniques for RESOLVING this (e.g. chain duplicates, rehash and so on). |
|