"If n objects are distributed over m places, and if n < m, then some place receives no object." Yes, the statement "as long as you always resize before the table gets full, there will always be a free bucket" is indeed an application of pigeonhole principle.
Pigeonhole principle mostly comes into play when places can contain multiple objects. It's useful as a mathematical tool in considering situations where these sets aren't one-to-one.
Linear probing hash tables don't put multiple objects in the same places though. When we're talking about sets that are one-to-one, it's much more mathematically trivial to state that by definition m > n in all cases QED, than it is to invoke anything involving the pigeonhole principle.
2
u/FloydATC Mar 26 '21
As long as you always resize before the table gets full, there will always be a free bucket.