摘要: A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
posted @ 2016-02-24 18:55 小爷 阅读(1511) 评论(0) 推荐(0)
摘要: 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 小爷 阅读(853) 评论(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 小爷 阅读(166) 评论(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 小爷 阅读(429) 评论(0) 推荐(0)