Live data from Hacker News

Ask HN: Does anyone else struggle with arrays?

news.ycombinator.com

1–10 of 11 posts

Re: Ask HN: Does anyone else struggle with arrays?

#6
post #4

Definitely it is easy to mistake 𝘪 for 𝘪+1 (or is it 𝘪-1?)

Which is more efficient?

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.

Post reply on HN