jeffgerickson / algorithms

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

Undefined index in algorithm in Fig 0.5. #257

Open Prithiviksit opened 2 years ago

Prithiviksit commented 2 years ago

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

Chapter number or note title: Chapter 0, Figure 0.5. The Huntington-Hill apportionment algorith.

Page number: 9

Error description: index i not defined in Insert(PQ, s, Pop[i]/sqrt(2))

Suggested fix (if any): Replace i with s and it should be Insert(PQ, s, Pop[s]/sqrt(2))