You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Exercise 1.5.4, it's noted that executing the find() function on a node at depth i results in i+1 accesses to the id[] array. This was particularly apparent when analyzing the example with the second pair input, 3 8, where executing find(3) resulted in two accesses since the parent of node 3 is node 4. However, there seems to be a contrasting scenario in Exercise 1.5.3, where the find() function on a node at the same depth i necessitates 2i+1 accesses.
This variance has caused some uncertainty, and I'm inclined to believe the formula from Exercise 1.5.3 might be the correct interpretation. Could there be a detail I've missed that explains this inconsistency, or is there a definitive correct approach among the two? I am seeking further clarification to comprehend the intended behavior of the find() function within these contexts
The text was updated successfully, but these errors were encountered:
You are correct, in the find() method we should count 2i + 1 accesses on depth i.
I updated exercise 1.5.4 to fix that: 62da660
Thanks for reporting this issue and for the contribution.
In Exercise 1.5.4, it's noted that executing the find() function on a node at depth i results in i+1 accesses to the id[] array. This was particularly apparent when analyzing the example with the second pair input, 3 8, where executing find(3) resulted in two accesses since the parent of node 3 is node 4. However, there seems to be a contrasting scenario in Exercise 1.5.3, where the find() function on a node at the same depth i necessitates 2i+1 accesses.
This variance has caused some uncertainty, and I'm inclined to believe the formula from Exercise 1.5.3 might be the correct interpretation. Could there be a detail I've missed that explains this inconsistency, or is there a definitive correct approach among the two? I am seeking further clarification to comprehend the intended behavior of the find() function within these contexts
The text was updated successfully, but these errors were encountered: