Glossary: Data Structures and Algorithms in C++
Off-by-one error
Also written: off-by-one
A mistake of exactly one in an index or comparison. Binary search's classic ones are `low < high` instead of `<=`, and `low = middle` instead of `middle + 1`.
Glossary: Data Structures and Algorithms in C++
Also written: off-by-one
A mistake of exactly one in an index or comparison. Binary search's classic ones are `low < high` instead of `<=`, and `low = middle` instead of `middle + 1`.