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.
Classic Algorithms Implemented in JavaScript
21–30 of 36 posts
Re: Classic Algorithms Implemented in JavaScript
#22Re: Classic Algorithms Implemented in JavaScript
#23Super job! As someone currently studying this stuff, this is a gold mine. It's hard to interview in this field if you didn't get a CS degree, and this sort of gesture is forever appreciated.
Re: Classic Algorithms Implemented in JavaScript
#24Lets pretend JS arrays had no queue api, why whouldn't I use native arrays to implement a queue?
Re: Classic Algorithms Implemented in JavaScript
#25What I would wish for is a list of common problems and how certain algorithms and data structures solve them.
Edit: just noticed this was already recommended below, take this as another strong endorsement!
Re: Classic Algorithms Implemented in JavaScript
#26Super job! As someone currently studying this stuff, this is a gold mine. It's hard to interview in this field if you didn't get a CS degree, and this sort of gesture is forever appreciated.
It’s hard to interview in this field even with a CS degree, unfortunately. The problem is there are too many people interviewing, with and without CS degrees.
My main issue is definitely the whiteboard portion of the competition. Complaining about those whiteboard skills being of negligible daily use on the job is getting me nowhere: the only solution is to study up. My strongest language is JS, so this repo is really, really nice.
Re: Classic Algorithms Implemented in JavaScript
#27Re: Classic Algorithms Implemented in JavaScript
#28The 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.
* ill - 2ae60a99f87408af77066079879865d907201ff44e7b1f26d911afcd1097c4c32162b97546c404d3a305396698ea530d3c3690adb7dcbc91ec685837f895a37b
* duh - e44e6d93cd165ec8cdeaa632abe1c35d9a71533cc68072e100c5307ea3be17bc4f10e258785bef77d31664be0f1c3f427528c7450d52082a90c4ee86c7012184
Re: Classic Algorithms Implemented in JavaScript
#29Earlier quoted context omitted.
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 :)
Re: Classic Algorithms Implemented in JavaScript
#30Earlier quoted context omitted.
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.
Using what hash mechanism? I tested with SHA512 and got different results: * ill - 2ae60a99f87408af77066079879865d907201ff44e7b1f26d911afcd1097c4c32162b97546c404d3a305396698ea530d3c3690adb7dcbc91ec685837f895a37b * duh - e44e6d93cd165ec8cdeaa632abe1c35d9a71533cc68072e100c5307ea3be17bc4f10e258785bef77d31664be0f1c3f427528c7450d52082a90c4ee86c7012184