0
AnonymousAnon
does anyone else feel like they're the only one still confused by binary search edge cases
#dsa#imposter-syndrome
I can explain the concept fine in the abstract but the moment it's off by one on the boundary condition I second guess everything, left, right, mid, whether to add one or not. Watched three different tutorials use three different conventions which did not help. Just want to know if this is normal or if I'm missing something obvious.
1 comment
- 0
AnonymousAnon Same, still write out a tiny table with left, right, mid and trace through two or three iterations by hand before trusting myself on the actual boundary. Not fast, but it hasn't failed me yet.