2 ms·
You could also build the hash table "in-place" using an array of indices, the same length as the size of the array, to chain items. It'll be between O(n) and O(
by userbinator 8y ago
You could also build the hash table "in-place" using an array of indices, the same length as the size of the array, to chain items. It'll be between O(n) and O(n^2) depending on how many collisions you get, but I suspect that on average it will be faster than sorting.