- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 猴王问题即约瑟夫算法解题过程-----我的推导过程(原创,转发请注明出处)
猴王问题可以做如下描述: 有n只猴子围成一圈,从第一个开始数,数到第m个将其踢出,接着后面继续从1数,如此循环,直到只剩最后一只z,那只就是猴王.输入n,m.输出z. 初次看到这个题目的时候,首先想到是实现一个循环列表,通过n次循环模拟该过程。但是该方法有一个明显的缺点:如果n的数值过大,程序很可能找不到足够的空间来实现循环列表。并且也有时间开销的问题。 --
2010-01-28 20:49:00 912
原创 sed 命令 用法简介
替换命令1. sed 一般被用来做字符替换,先从最简单的替换命令开始: sed s/afei/yujian/ myfile.txt -------- 这条命令的意思是把myfile.txt里面的afei 替换为yujian.注意:sed命令是按行替换,上面的语句严格来说是会用yujian替换 myfile.txt 文件里每一行的第一个afei.模式空间 —— 保存
2010-01-18 10:19:00 1304
原创 1.2.4. Garbage Collection
Memory is a shared and limited resource and should not be wasted, particularly in the kernel because it does not use virtual memory. Most kernel subsystems implement some sort of garbage collection to
2009-12-11 17:23:00 515
原创 1.2.2. Caching and Hash Tables 高速缓存和哈希表
1.2.2. Caching and Hash TablesIt is pretty common to use a cache to increase performance. In the networking code, there are caches for L3-to-L2 mappings (such as the ARP cache used by IPv4), for the r
2009-12-07 11:00:00 691
原创 《Understanding Linux networking 》1.1 Basic Terminology
In this section, Ill introduce terms and abbreviations that are going to be used extensively in this book.本节里,会介绍那些在这本书里广泛应用到的术语和缩写词。Eight-bit quantities are normally called octets in the networ
2009-11-18 17:06:00 406
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人