随笔分类 -  Algorithm

描述各种算法~
摘要:最近看到一个阿里的面试题目,觉得很有意思,遂记下。 阿里2014年笔试题目,(选择题)是给定生成1-7的随即函数rand_7,看是否能生成其它随机数? A. rand_3 B. rand_21 C. rand_23 D.rand_47首先从最简单的开始,给定一个能够随机生成1到7之间数字的r... 阅读全文
posted @ 2015-03-04 11:51 菜鸟加贝的爬升 阅读(457) 评论(0) 推荐(0)
摘要:字符串的编辑距离也被称为距Levenshtein距离(Levenshtein Distance),属于经典算法,常用方法使用递归,更好的方法是使用动态规划算法,以避免出现重叠子问题的反复计算,减少系统开销。 《编程之美》一书中3.3节中计算两个字符串的相似度,归根到底也是要求两个字符串的距离,其... 阅读全文
posted @ 2013-10-06 10:55 菜鸟加贝的爬升 阅读(6538) 评论(1) 推荐(0)
摘要:Amazon Campus(2013-Sep-24)Question 2 / 2 (Amazon Campus(17):Find the differences of items in amazon)Amazon has millions of different items in different categories right now, so when sellers want to sell items in our website, sellers want to find the right categories their items belong to. Suppose we 阅读全文
posted @ 2013-10-05 22:08 菜鸟加贝的爬升 阅读(981) 评论(0) 推荐(0)