Wow! You are absolutely right. Thanks for flagging this. I’ve documented it in the errata thread and have also flagged it for correction in future printings.
kirupa
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Errata: Data Structures and Algorithms Book! | 14 | 1489 | March 13, 2025 | |
| Why does this binary search return -1 for values that are clearly in the array? | 3 | 6 | April 6, 2026 | |
| Why does this binary search get stuck near the end? | 3 | 8 | April 7, 2026 | |
| Why does this binary search return the wrong insertion index for some targets? | 3 | 6 | April 5, 2026 | |
| Why does this binary search return the wrong insertion index for some targets? | 1 | 3 | April 3, 2026 |