JavaScript Algorithms and Data Structures (2018)
github.com
github.com
The obvious answer to all of the above rhetorical questions - fuck no.
That being said, it is still a topic of interviews, so I will up-vote bc this is pretty good implementation, even though this repo has been submitted to HN at least 4 times in the past.
Someone also mentioned Mnemonist [1] - that one is nice too.
If I interview someone I don’t go deep into algorithms but I want to know that they know how about binary search or hashmaps. Ignorance of these shows ignorance of the basics of computation.
The tech industry has normalized to the state of asking such question - its rare to be interviewed on domain expertise, unless you are interviewing at a fortune 500 big corp.
I’m sure it’s popular. But it’s not everywhere.
You can clearly see the impact of computational ignorance on the modern web. JS engines have been optimized to hell and back and there are _still_ sites out there that are godawful slow for no good reason at all.
There are other algorithms and use cases for a stable iteration into an ordered sequence, but I can’t think of any off-hand. It is true that it’s rare to prefer a linked list on modern CPU architecture.
The one other time a linked list is really good is if the list is large, and you can't afford the chance that you need to resize the array backing the vector.
But, yes; while real life performance characteristics vary (cache locality can lead to surprising wins for arrays even on insertions/deletions), at least theoretically, there are use cases where a LinkedList will win out.
EDIT: Huh. They also list the insertion and deletion cost of a hash table as being O(n). That...is not right. I mean, they call out "in the case of a perfect hash function it would be 1", but treating the literal worst case as the actual runtime is like saying quicksort runs in O(n^2) (which the author does not do).
Can anyone suggest good Data structures and algorithms resource like this but not written in JavaScript?
You will learn much more than by simply seeing the entire code already implemented.
If you however need a strong implementation of some algorithm to use in production, you may want to search a robust library implementing it instead.