general hash function question

68 Views Asked by At

The question: let it be two data structures that are represented by hash tables $T_1,T_2$ with chaining ($T_1,T_2$ are arrays of linked lists), and hash functions h1,h2 accordingly. Suppose that the distribution of keys is sufficiently uniform by $h_1$ and $h_2$.

Is it true that you can merge/unify this two data structures into one data structure from that same type (hashing with chaining) with $n$ elements in $O(logn)$ at worst case?

The answer here is no, and I don't understand why. For example, I can define the new data structure with tables $T_1,T_2$ and functions $h_1,h_2$. it takes $O(1)$, and I can implement the known methods like that:

insertion(x)- insert to one of the tables with one of the functions- $O(1)$.

search(x)- search in both the tables. It's $O(1)$ expected.

delete(x)- search in both tables. If you found $x$, delete him- $O(1)$ expected.

where am I wrong here?