JavaScript Algorithms and Data Structures (2018)
11–20 of 36 posts
Re: JavaScript Algorithms and Data Structures (2018)
#12Is there any practical reason use, say, a linked list from this library vs javaScript's native growable array. You can use unshift() to delete in the middle.
Re: JavaScript Algorithms and Data Structures (2018)
#13Do we really need yet another list of algorithms to memorize for interviews? Is another list going to make a better JavaScript engineer? Will help me understand JavaScript better? Will it help me on the job? Will it make me a faster and better React developer? 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…
Re: JavaScript Algorithms and Data Structures (2018)
#14Re: JavaScript Algorithms and Data Structures (2018)
#15Is there any practical reason use, say, a linked list from this library vs javaScript's native growable array. You can use unshift() to delete in the middle.
Re: JavaScript Algorithms and Data Structures (2018)
#16Similar collection of data structure for JavaScript, with a focus on performance: Mnemonist [1]. [1]: https://yomguithereal.github.io/mnemonist/
Re: JavaScript Algorithms and Data Structures (2018)
#17Is there any practical reason use, say, a linked list from this library vs javaScript's native growable array. You can use unshift() to delete in the middle.
Presumably, inserting and removing from the middle of a linked list is much faster than from an array.
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).
Re: JavaScript Algorithms and Data Structures (2018)
#18Well, it's good resource. pleased by it. Can anyone suggest good Data structures and algorithms resource like this but not written in JavaScript?
Re: JavaScript Algorithms and Data Structures (2018)
#19Is there any practical reason use, say, a linked list from this library vs javaScript's native growable array. You can use unshift() to delete in the middle.
Presumably, inserting and removing from the middle of a linked list is much faster than from an array.
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.
Re: JavaScript Algorithms and Data Structures (2018)
#20Do we really need yet another list of algorithms to memorize for interviews? Is another list going to make a better JavaScript engineer? Will help me understand JavaScript better? Will it help me on the job? Will it make me a faster and better React developer? 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…
Reciting algorithms is reverse gatekeeping. If an employer wants to grill you on them, get out of there.