jeffgerickson / algorithms

Bug-tracking for Jeff's algorithms book, notes, etc.
7.88k stars 1.02k forks source link

[Oops.] 2.8 Small typo in recursive formula #288

Open ethansirois opened 4 months ago

ethansirois commented 4 months ago

Please verify that the error is present in the most recent revision before reporting.

Chapter number or note title: 2.8

Page number: 92

Error description: It seems like an i in a summation formula is supposed to be a j. I think this because of how the other formulas were set up, it currently sums the same f[i] from j to k, essentially adding f[i] * (k - i)

Suggested fix (if any): I believe that the summation should compute f[j], since it will be all the access frequencies that go through the root for the subtree containing vertices v_i to v_k.