Hashing implementation doubt

insert function is used in rehash function but it is defines rehash function

why it is not showing error then?

Hello @yatin,

Your question is not clear.

I am answering it as per what i have understood from it.

  1. Why calling insert() function inside the rehash() function does not causes any error?
    Reason:
    We have updated the value of ts in the rehash function before calling the insert function. and hence the size of bucket has been increased.

  2. We have declared the insert() function after the rehash() function. Why isn’t it causing any issue?
    Reason:
    At the time when rehash invoked, the definition of insert function was already know to the compiler. So, it didn’t lead to any error.

Hope, this would help.

my doubt was in the second point
i got it sir
thank you

@yatin,

Please, mark this doubt as resolved.
BTW, I won’t mind a like.:wink: