上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 274 下一页
摘要: Apriori算法与实例 R. Agrawal 和 R. Srikant于1994年在文献【2】中提出了Apriori算法,该算法的描述如下: 下面是一个具体的例子,最开始数据库里有4条交易,{A、C、D},{B、C、E},{A、B、C、E},{B、E},使用min_support=2作为支持度阈值 阅读全文
posted @ 2018-04-03 14:31 bonelee 阅读(10582) 评论(0) 推荐(0)
摘要: 涉及到tree的题目无非是遍历,三种遍历你要非常熟悉,本题目是后序遍历,你自己在头脑中自底向上模拟tree的遍历就知道怎么求解了!这个题目是谷歌面试遇到的,,,不过它要求的是找出所有的路径! 也可以在迭代每一个node的时候,记录下其diameter,ans就是所有node diameter最大值: 阅读全文
posted @ 2018-04-02 23:20 bonelee 阅读(319) 评论(1) 推荐(0)
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1 Example 2 Note: Your a 阅读全文
posted @ 2018-04-02 22:24 bonelee 阅读(227) 评论(0) 推荐(0)
摘要: DBSCAN方法及应用 1.DBSCAN密度聚类简介 DBSCAN 算法是一种基于密度的聚类算法: 1.聚类的时候不需要预先指定簇的个数 2.最终的簇的个数不确定DBSCAN算法将数据点分为三类: 1.核心点:在半径Eps内含有超过MinPts数目的点。 2.边界点:在半径Eps内点的数量小于Min 阅读全文
posted @ 2018-04-02 12:06 bonelee 阅读(44588) 评论(0) 推荐(4)
摘要: Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the ave 阅读全文
posted @ 2018-04-01 23:37 bonelee 阅读(201) 评论(0) 推荐(0)
摘要: >>> a=[[0]*3 for i in range(3)]>>> a[[0, 0, 0], [0, 0, 0], [0, 0, 0]]>>> a[1][1]=121>>> a[[0, 0, 0], [0, 121, 0], [0, 0, 0]]>>> a[0][0]=11>>> a[[11, 0 阅读全文
posted @ 2018-04-01 23:37 bonelee 阅读(669) 评论(0) 推荐(0)
摘要: Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
posted @ 2018-04-01 22:46 bonelee 阅读(230) 评论(0) 推荐(0)
摘要: 参数解释: (1)iterable指定要排序的list或者iterable,不用多说; (2)cmp为函数,指定排序时进行比较的函数,可以指定一个函数或者lambda函数,如: students为类对象的list,没个成员有三个域,用sorted进行比较时可以自己定cmp函数,例如这里要通过比较第三 阅读全文
posted @ 2018-04-01 22:26 bonelee 阅读(25809) 评论(0) 推荐(1)
摘要: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文
posted @ 2018-04-01 22:16 bonelee 阅读(280) 评论(0) 推荐(0)
摘要: Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2018-04-01 21:07 bonelee 阅读(223) 评论(0) 推荐(0)
上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 274 下一页