walkccc / CLRS

📚 Solutions to Introduction to Algorithms Third Edition
https://walkccc.me/CLRS
MIT License
4.65k stars 1.26k forks source link

Update 5.1.md #393

Closed devamgupta closed 3 years ago

devamgupta commented 3 years ago

In the Random(a,b) function (line 25) the for loop should go from 0 to bits - 1 (line 29) because we want to generate numbers from range 0 to 2 ^ bits (not 2 ^ bits + 1). Also there should be left shift operation (<<). (line 31)