5 ms·
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?
- pacerier 4y agoNo (in those good times, "software development" was not overloaded to mean everything/anything so that all is said to be proficient at it).
- PaulHoule 4y agoDefinitely it is easy to mistake 𝘪 for 𝘪+1 (or is it 𝘪-1?)
- shrthnd 4y agoWhich is more efficient?
- PaulHoule 4y agoIt 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.
- superchroma 4y agoGenerally, 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?
- DumbArray 4y agoYeah, this question was prompted by leetcode lol <grimaces>
- badpun 4y agoIf 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.
- joshxyz 4y agoyep to this day and age i still google how to array sorr in javascript.
- _448 4y agoCould you be more specific what you find difficult? That will help others provide you with guidance.
- dev_0 4y ago