Live data from Hacker News

Classic Algorithms Implemented in JavaScript

github.com

11–20 of 36 posts

Re: Classic Algorithms Implemented in JavaScript

#14
This is amazing! I’ve forked this with plans to translate all of it to TypeScript, which really just means adding about 10 times per file, erasing the java doc comments and replacing them with actual parameter types. Still worth it!

Re: Classic Algorithms Implemented in JavaScript

#18

The implementation of a hash table uses a hash table, which feels like cheating to me. Also I suspect that adding together the ascii values of the characters in the key is not necessarily the best hash function.

the keywords "ill" and "duh" will cause collision. I know this because I ran into this issue trying to be clever on leetcode's anagram grouping problem.

Re: Classic Algorithms Implemented in JavaScript

#19
post #5

What I would wish for is a list of common problems and how certain algorithms and data structures solve them.

Well its not a list per se but many of the interview prep sites tag their problems with the appropriate algorithm/data structure for the job. As someone who has his first SV phone technical interview on Monday and has done ~30 problems in the last two weeks, I can say after solving about 2-3 of them over a number of hours or days you start to recognize which algorithm will get the job done from the problem descriptions.

Re: Classic Algorithms Implemented in JavaScript

#20
post #5

What I would wish for is a list of common problems and how certain algorithms and data structures solve them.

Well its not a list per se but many of the interview prep sites tag their problems with the appropriate algorithm/data structure for the job. As someone who has his first SV phone technical interview on Monday and has done ~30 problems in the last two weeks, I can say after solving about 2-3 of them over a number of hours or days you start to recognize which algorithm will get the job done from the problem descriptio…

Interesting :D

Would be nice if you could post a list of your resources :)

Post reply on HN