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?
Ask HN: Does anyone else struggle with arrays?
1–10 of 11 posts
Re: Ask HN: Does anyone else struggle with arrays?
#2Definitely it is easy to mistake 𝘪 for 𝘪+1 (or is it 𝘪-1?)
Re: Ask HN: Does anyone else struggle with arrays?
#3Generally, 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?
Re: Ask HN: Does anyone else struggle with arrays?
#4Definitely it is easy to mistake 𝘪 for 𝘪+1 (or is it 𝘪-1?)
Which is more efficient?
Re: Ask HN: Does anyone else struggle with arrays?
#5Generally, 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?
Yeah, this question was prompted by leetcode lol
Re: Ask HN: Does anyone else struggle with arrays?
#6Definitely 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.
Re: Ask HN: Does anyone else struggle with arrays?
#7If 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.
Re: Ask HN: Does anyone else struggle with arrays?
#8yep to this day and age i still google how to array sorr in javascript.
Re: Ask HN: Does anyone else struggle with arrays?
#9Could you be more specific what you find difficult? That will help others provide you with guidance.
Re: Ask HN: Does anyone else struggle with arrays?
#10No post body was provided.