by nopenopenopeno · 4y ago · 0 comments
Well, that is wrong. Single value accesses are O(1) amortized.
Also, Java is a lower level language but I don’t think simply programming in Java instead teaches you this. Either way, it’s the difference between learning how to write programs and learning computer science.
I suppose that’s also fair. I would say that Java at least makes you aware that there is magic afoot. You have to explicitly write that you’d like to use a HashMap, at which point someone writing or reading the code might wonder “what’s that?” Instead, python hides behind the abstraction of a “dictionary” when it should be in my opinion broadcasted from the high heavens that this is a hash map in disguise.
As far as the remainder of your comment, I agree wholeheartedly. Learn computer science. It makes you a better programmer.
With that said I highly recommend the classic Introduction to Algorithms (CLRS for short) by Cormen et Al. It is written in clear and straightforward language. And the lectures on MIT OCW by Erik Demaine are outstanding.
By reading and watching the lectures I deeply understood stuff that I had just muddled through previously.
at my first programming job (now almost 30 years ago), I remember implementing the red-black tree algorithms in C from that book. It is chock full of really useful ideas that will make your systems better.