Tries: Contacts

  • + 1 comment

    Hi rshaghoulian,

    A small doubt here.. in the add method the following two lines of code are confusing me a bit:

    curr = curr.getChild(ch); curr.size++;

    Why are we incrementing the size variable of the child, shouldn't we be increasing the size variable of the parent?

    Shouldn't it be :

    curr.size++; curr = curr.getChild(ch);

    Thank you in advance!