Consider a hash table with chaining scheme for overflow handling:
These are the constraints that we have to consider while insertion.Check the algo for insertion into hash table with chains : - http://faculty.cs.niu.edu/~freedman/340/340notes/340hash.htm
@ashok7273 @Sourajit25 @Verma Ashish
In case of chaining insertion of one element takes O(1) time So in worst case ,for 'n' elements....T(n)=O(n)
why this is only true for worst case just think about it. It is true for average and best case also.
we have n elements which we want to insert in hash table. It doesn’t matter if we are inserting the same cell or different cells. Each insertion take O(1) time then why only for worst case it is true for average or best case also.
anyone verify I’m saying correct or not...
Extending @Sourajit25‘s comment, I believe the answer for this question would be –
64.3k questions
77.9k answers
244k comments
80.0k users