Design a hashmap of size N, using only 2 un-initialized array of size N, that can support following operations. hashmap.set(key), hashmap.isPresent(key), and hashmap.clearAll() where 0 <= key <= (N-1). (All operations in constant time).
Note: - the arrays are un-initialized and can have any values stored. (Any pre-processing of array must in done in constant time)
Aucun commentaire:
Enregistrer un commentaire