data structures - Hashing analysis in hashtable -
the search time hash value o(1+alpha) ,
alpha = number of elements/size of table
i don't understand why 1 added?
the expected number elements examined
(1/n summation of i=1 n (1+(i-1/m)))
i don't understand too.how derived?
(i know how solve above expression , want understand how has been lead expression..)
edit : n number of elements present , m number of slots or size of table
i don't understand why 1 added?
the o(1) there tell if there no element in bucket or hash table @ all, you'll have compute key hash value , won't instantaneous.
your second part needs precisions. see comments.
edit: second portion there "amortized analysis", idea consider each insertion in fact in set of n insertions in empty hash table, each lookup take o(1) hashing plus o(i-1/m) searching bucket content considering each bucket evenly filled respect previous elements. resolution of sum gives o(1+alpha) amortized time.
Comments
Post a Comment