You are viewing a single comment's thread. Return to all comments →
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!
Seems like cookies are disabled on this browser, please enable them to open this website
Tries: Contacts
You are viewing a single comment's thread. Return to all comments →
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!