Domanda di colloquio di Amazon

How would you implement a hash table?

Risposta di colloquio

Anonimo

1 mag 2018

I used arrays with chaining. Allocate an initial array, generate a hash value, modulo that value by the array length for an index. If a collision occurs, allocate another array, redirect the original array index to this array, repeat the process on this array, creating a "chain" of arrays.