上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 34 下一页
摘要: Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.搜了一下,才知道这道题可以写这么简洁。 1 class ... 阅读全文
posted @ 2014-09-22 20:35 linyx 阅读(160) 评论(0) 推荐(0) 编辑
摘要: huffman是非常基础的压缩算法。实现霍夫曼树的方式有很多种,可以使用优先队列(Priority Queue)简单达成这个过程,给与权重较低的符号较高的优先级(Priority),算法如下:⒈把n个终端节点加入优先队列,则n个节点都有一个优先权Pi,1 ≤ i ≤ n⒉如果队列内的节点数>1,则:... 阅读全文
posted @ 2014-09-22 19:49 linyx 阅读(1126) 评论(0) 推荐(0) 编辑
摘要: 拥塞控制算法:1.加性增、乘性减;2.慢启动;3.对超时事件作出反应;整体过程如下:慢启动->到达阈值->加性增(窗口+1个MSS),这个阶段叫拥塞避免(CA)->3个冗余ack丢包(事件)->阈值和窗口都缩小为一半(乘性减), 然后加性增(CA)->快速重传,并等待确认,这个阶段叫快速恢复,如果没... 阅读全文
posted @ 2014-09-22 12:27 linyx 阅读(611) 评论(0) 推荐(0) 编辑
摘要: 作为一个软件开发者,你一定会对网络应用如何工作有一个完整的层次化的认知,同样这里也包括这些应用所用到的技术:像浏览器,HTTP,HTML,网络服务器,需求处理等等。本文将更深入的研究当你输入一个网址的时候,后台到底发生了一件件什么样的事~1. 首先嘛,你得在浏览器里输入要网址:2. 浏览器查找域名的... 阅读全文
posted @ 2014-09-21 23:10 linyx 阅读(3307) 评论(0) 推荐(0) 编辑
摘要: 最近想搞spark。没有集群环境,想先在单机上跑。但是两年前一直用到现在的virtualbox已经太老,很多源都停更了。所以准备装ubuntu14.04。0. 更新源。163的源有问题,用的是sohu的源; 1 deb http://mirrors.sohu.com/ubuntu/ trusty m... 阅读全文
posted @ 2014-09-21 21:06 linyx 阅读(196) 评论(0) 推荐(0) 编辑
摘要: escape()除了 ASCII 字母、数字和特定的符号外,对传进来的字符串全部进行转义编码,因此如果想对URL编码,最好不要使用此方法。而encodeURI() 用于编码整个URI,因为URI中的合法字符都不会被编码转换。encodeURIComponent方法在编码单个URIComponent(... 阅读全文
posted @ 2014-09-21 19:12 linyx 阅读(615) 评论(0) 推荐(0) 编辑
摘要: constconst指针1 char greeting[] ="hello"; 2 char* p = greeting; // non-const pointer, non-const data3 const char* p = greeting; // non-const pointer, co... 阅读全文
posted @ 2014-09-21 13:50 linyx 阅读(174) 评论(0) 推荐(0) 编辑
摘要: A suffix tree (also called PAT tree or, in an earlier form, position tree) is a compressed trie containing all the suffixes of the given text as their... 阅读全文
posted @ 2014-09-18 17:06 linyx 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 1 top - 11:22:42 up 9:53, 1 user, load average: 0.00, 0.01, 0.052 Tasks: 137 total, 1 running, 136 sleeping, 0 stopped, 0 zombie3 Cpu(s): 3.... 阅读全文
posted @ 2014-09-17 23:38 linyx 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 字典树 1 class Trie { 2 public: 3 Trie() { 4 root = new Node(); 5 } 6 7 ~Trie() { 8 destroy(root); 9... 阅读全文
posted @ 2014-09-17 23:32 linyx 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 34 下一页