Re:Ask HN: Does anyone else struggle with arrays?
by shrthnd on Wednesday November 16, 2022 @08:11PM
(#33633579)
Which is more efficient?
[ Parent
| on HN ]
Re:Ask HN: Does anyone else struggle with arrays?
by PaulHoule on Wednesday November 16, 2022 @08:40PM
(#33633812)
It is not so much as which is efficient as which is correct. Implementing many algorithms it is easy to pick the wrong one which is most problematic when it gives answers that are almost right.
Pro tip. Unit tests are super effective for algorithms that are tricky. Write some simple test cases and understand how they work using the debugger.