上一页 1 2 3 4 5 6 7 8 ··· 21 下一页
摘要: Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each va 阅读全文
posted @ 2016-02-24 18:53 小爷 阅读(838) 评论(0) 推荐(0) 编辑
摘要: Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3*5*6*7, where 5, 6, a 阅读全文
posted @ 2016-02-24 18:52 小爷 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1、信息熵 一些概念 p(x):分类结果x的概率,即分类结果为x的数据量/总数据量信息:l(x) = -log2(p(x))信息熵:信息的期望值 -(p(x1)l(x1) + p(x2)l(x2) + ……) 计算信息熵 1 def calcShannonEnt(dataset): 2 numEnt 阅读全文
posted @ 2016-02-24 01:12 小爷 阅读(419) 评论(0) 推荐(0) 编辑
摘要: Zhejiang University has 6 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers of the cars crossing the g 阅读全文
posted @ 2016-02-23 18:54 小爷 阅读(628) 评论(0) 推荐(0) 编辑
摘要: A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find t 阅读全文
posted @ 2016-02-23 18:50 小爷 阅读(281) 评论(0) 推荐(0) 编辑
摘要: The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed 阅读全文
posted @ 2016-02-23 18:48 小爷 阅读(517) 评论(0) 推荐(0) 编辑
摘要: Eva would like to make a string of beads with her favorite colors so she went to a small shop to buy some beads. There were many colorful strings of b 阅读全文
posted @ 2016-02-23 18:46 小爷 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1、kNN 算法 算法说明: set<X1,X2……Xn> 为已知类别数据集,预测 点Xt 的类别: (1)计算中的set中每一个点与Xt的距离 (2)按距离增序排列 (3)选择距离最小的前k个点 (4)确定前k个点所在的类别的出现频率 (5)返回频率最高的类别作为测试的结果 1 from nump 阅读全文
posted @ 2016-02-22 20:18 小爷 阅读(2823) 评论(0) 推荐(0) 编辑
摘要: Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push ( 阅读全文
posted @ 2016-02-14 01:13 小爷 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c 阅读全文
posted @ 2016-02-02 21:14 小爷 阅读(194) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 21 下一页