摘要: 在Huffman编码树是基于加权最短路径树,具体定义见:Huffman Coding Huffman编码树的实现过程 输入各个字符已经相应的字符权重 构建Huffman编码树节点向量 在向量中查找权重最小的两个节点,新建一个新的节点,其左右子树是两节点,权重为两个子树权重之和 添加到向量中,并删除两个字数 重复3-4,直到只有一个节点 注意点: 查找两个最小节点的采用的是 Divide an... 阅读全文
posted @ 2016-05-17 19:38 南瓜_waniu 阅读(323) 评论(0) 推荐(0)
摘要: 思路 新浪微博API接口提供了获取附近位置的微博用户的API接口,因此尝试通过分析春节期间全国用户各地微博用户分布情况,再结合用户注册地信息,粗略分析人口流动情况。 数据获取 0:新浪微博API接口 NearbyUser:http://open.weibo.com/wiki/2/place/near 阅读全文
posted @ 2016-05-03 21:07 南瓜_waniu 阅读(272) 评论(0) 推荐(0)
摘要: 试题题目描述很简单 给两个二叉树,判断第二个二叉树是否为第一棵二叉树的字数,并且二叉树节点的值没有重复的。 二叉树节点定义: typedef struct tnode{ int val; struct tnode* left; struct tnode* right;}; int isSubtree 阅读全文
posted @ 2016-04-23 21:04 南瓜_waniu 阅读(203) 评论(0) 推荐(0)
摘要: Little Hi runs a web server. Sometimes he has to deny access from a certain set of malicious IP addresses while his friends are still allow to access 阅读全文
posted @ 2016-04-16 17:35 南瓜_waniu 阅读(118) 评论(0) 推荐(0)
摘要: Steven loves reading book on his phone. The book he reads now consists of N paragraphs and the i-th paragraph contains ai characters. Steven wants to 阅读全文
posted @ 2016-04-14 20:54 南瓜_waniu 阅读(289) 评论(0) 推荐(0)