Thus, for all buckets,
What is the probability that an element will be inserted into some bucket i?
Answer: p = 1/n.
Given n trials consisting of putting elements into buckets, how many elements
will be inserted into bucket i?
Therefore, TIS =
and TBS = 4n + n + 3 = O(n) for the average case.
In the worst case, the run time is n2.