Ask HN: Does anyone else struggle with arrays?
I find it difficult to implement low-level array-based algorithms and data structures (sort, queues, stacks, etc.) from scratch, even though I'm proficient at software development in general. Is this a common thing?
10 comments
Could you be more specific what you find difficult? That will help others provide you with guidance.
No (in those good times, "software development" was not overloaded to mean everything/anything so that all is said to be proficient at it).
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.
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.
Generally, pretty efficient implementations of such should be already provided in most core libraries along with the data structures in question.
Are you practicing for l33tcode or something?
Are you practicing for l33tcode or something?
Yeah, this question was prompted by leetcode lol <grimaces>
If you've never programmed in a lower-level language before, then it's a new skill that you have to build from the ground-up. Just keep practicising and you'll get better quickly - it's not that hard.
yep to this day and age i still google how to array sorr in javascript.