msambol / dsa

Data structures and algorithms in X minutes. Code examples from my YouTube channel.
https://youtube.com/michaelsambol
MIT License
459 stars 100 forks source link

Fix error in right_rotate #2

Closed mindotale closed 2 years ago

mindotale commented 2 years ago

Functions right_rotate and left_rotate should be symmetrical. So that we can replace left with right and vice versa and get the second function. This is not the case, so I think this is a mistake. I also tested it myself and after the fix, my code started working correctly.