5 ms·
Can you give some examples of which algorithm have been the most relevant/helpful?
by krsunny 13y ago
Can you give some examples of which algorithm have been the most relevant/helpful?
- sergiotapia 13y agoHis silence is highly amusing to me. :)
- drgath 13y agoI was recently asked a "making change" question [1] in a front-end interview, and once I finally understood it, it really really helped my comprehension of how to properly dissect tree-recursion-branching problems. Here's the code, https://gist.github.com/derek/8073844 https://gist.github.com/derek/8073844. Another one that popped up in an interview was sub-string matching, which I bombed, but after learning Boyer-Moore-Horspool I have a much greater understanding of efficiently designing algorithms. It is the algorithm some browsers use under the hood for String.prototype.indexOf [3]. Here's that code, https://gist.github.com/derek/8035740 https://gist.github.com/derek/8035740. [1] http://en.wikipedia.org/wiki/Change-making_problem http://en.wikipedia.org/wiki/Change-making_problem [2] http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Hor... [3] http://javascriptrules.com/2009/08/12/string-searching-algorithms-in-javascript-engines/ http://javascriptrules.com/2009/08/12/string-searching-algor...