With hindsight, I think it would have merit to proceed in stages:
a) special case K == 1, no spills (just grow table & rehash) - private?
b) special case K == 1
c) general K (see question)
d) elaborate "free" management for spill? May well prove not worth it
- special case K == 1, no spills (just grow table & rehash) - private?
- special case K == 1
- general K (see question)
- elaborate "free" management for spill? May well prove not worth it
To have spelled out in an answer what indy's comment highlights:
Keeping Ts instead of (shared(?)) pointers(/references?) uses a lot of space, especially where items are significantly bigger than their keys. And it initialises a lot of Ts.
Having table size exceed nominal capacity is conventional, their quotient designated load factor. M looks the latter's reciprocal, but even 2 is a lot: conventionally, a floating point value is used here. Likewise, a spill area the size of nominal capacity is anything but shy.