上一页 1 2 3 4 5 6 ··· 8 下一页

2013年5月19日

C++ Primer 读书笔记 - 第一章

摘要: 这一章算是简介。自己写了几个程序。1. main函数的返回值int main(){ //after ./a.out, execute 'echo $?', it will output 7. return 7;}2. 对comment的理解#include <iostream>using namespace std;int main(){ cout << "/*"; cout << "*/"; cout << /* "*/" */";}3. 对输入的理解#inc 阅读全文

posted @ 2013-05-19 08:02 NULL00 阅读(737) 评论(3) 推荐(0) 编辑

Storage Systems

摘要: 1. MountMount - Combine the FSes into one namespace. All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the filesystem found on some device to the big file tree.Th 阅读全文

posted @ 2013-05-19 06:12 NULL00 阅读(288) 评论(0) 推荐(0) 编辑

2013年2月27日

各种小结

摘要: Implement wget in JavaURL gotoUrl = new URL(url);InputStreamReader isr = new InputStreamReader(gotoUrl.openStream());BufferedReader in = new BufferedR... 阅读全文

posted @ 2013-02-27 06:52 NULL00 阅读(956) 评论(0) 推荐(0) 编辑

2013年2月7日

面试题笔记

摘要: 反转一个无符号整数的比特位.Reverse the bits of an unsigned integer.For example, x is 0x00001234, then reverse(x) is 0x2C480000.static uint Reverse(uint x){ uint... 阅读全文

posted @ 2013-02-07 10:50 NULL00 阅读(1502) 评论(1) 推荐(2) 编辑

2012年11月23日

用Excel打开csv格式文件并生成相应图形

摘要: 在UNIX/LINUX服务器端生成了csv格式文件之后,有时需要根据csv文件的数据画图。这时可以把csv格式文件传输到windows端,然后再用Excel来处理。直接用Excel打开时,所有数据都会挤在一列里。我们可以新建一个Excel,然后点击“数据”,再点击“自文本”当数据生成标准的Excel之后,再点击“插入”,选择“图表”中的各项,生成相应的图形。 阅读全文

posted @ 2012-11-23 09:34 NULL00 阅读(10135) 评论(0) 推荐(0) 编辑

2012年11月22日

虚拟内存(Virtual Memory)

摘要: Each process has its own virtual address space, so the virtual address 0xdead0000 in one process's address space will represent a different physical page than the page represented by 0xdead0000 in another process. Each process has it's own mapping from virtual addresses to physical addresses 阅读全文

posted @ 2012-11-22 06:05 NULL00 阅读(3803) 评论(1) 推荐(0) 编辑

2012年10月29日

僵尸进程 & 孤儿进程 & UNIX异常控制流相关函数

摘要: 僵尸进程(Zombie Process):子进程结束,父进程没有等待(即没有调用wait/waitpid函数)它,那么它成为僵尸进程孤儿进程(Orphan Process):一个父进程退出,而它一些子进程还在运行中,那么这些子进程将成为孤儿进程;孤儿进程将被init进程收养,即init进程为其父进程父进程退出时,若它的某些子进程为僵尸进程,那么这些僵尸进程也退出。因而在系统中,若想杀死僵尸进程,其中的一个办法就是杀死其父进程。下面这个例子演示的就是僵尸进程,在运行的时候,可以用"ps -ef | grep defunct"进行查看。#include <sys/type 阅读全文

posted @ 2012-10-29 14:12 NULL00 阅读(1413) 评论(0) 推荐(0) 编辑

2012年10月8日

POJ 2406 Power Strings (KMP)

摘要: 题目地址:http://poj.org/problem?id=2406对于这道题,考的就是KMP算法中对于子串的自匹配模式的考察。具体的KMP算法可参看KMP算法详解,主要看对B串的处理。这题给出一个比较特殊的测试数据供大家参考aabaaaba结果应该为2 1 #include <stdio.h> 2 #include <string.h> 3 4 void result(char str[1000001]) 5 { 6 int i; 7 int j; 8 int len = strlen(str); 9 int p[1000001];10 p[0] = -1;11 . 阅读全文

posted @ 2012-10-08 12:10 NULL00 阅读(540) 评论(0) 推荐(0) 编辑

2012年7月6日

算法导论 18-2 连接与分裂2-3-4树

摘要: CLRS 18-2连接与分裂2-3-4树 连接操作的输入为两个动态集合S'和S'',以及一个元素x,使得对任何x'ε S',x'' ε S'',有key[x'] < key[x] < key[x'']。它返回一个集合S = S' U {x} U S''。分裂操作有点像一个“逆”操作:给定一个动态集S和一个元素xε S,它创建一个集合S',其中包含了S - {x}中所有关键字小于key[x]的元素;同时创建了一个集合S'',其中包含了S - 阅读全文

posted @ 2012-07-06 15:23 NULL00 阅读(2382) 评论(0) 推荐(0) 编辑

2012年7月2日

POJ 2479 Maximum sum (动态规划)

摘要: POJ 2479 Maximum sum,题目大意是:对于给定的整数序列A={a1, a2,..., an},我们如下定义函数 d(A):我们的目标就是求出d(A)解决方案:这个题目是一个典型的动态规划题目,我们可以这样看,d(A)最大,即两个子序列之和最大,而这两个子序列是不相交的,因而我们可以将题目转换为如下形式:第一步,对于位置i,求i左边序列(可以包含i)的最大值和i右边序列的最大值。在程序中分别用leftMax和rightMax数组进行保存。第二步,然后对i取不同的值,即遍历i,得到d(A)。如对于序列A = {1 -1 2 2 3 -3 4 -4 5 -5},我们对于A[0],求其 阅读全文

posted @ 2012-07-02 15:04 NULL00 阅读(2361) 评论(0) 推荐(0) 编辑

2012年6月29日

POJ 2418 Hardwood Species

摘要: 题目地址为http://poj.org/problem?id=2418这题,我起先用的是AVL树,结果时间超时,最后发现,直接用二叉树就行了,根本就不需要旋转。由于数据是随机的,因而这棵二叉树的性能还行。当然还可以用trie树来解决。题目很简单,直接上代码 1 #include <iostream> 2 #include <stack> 3 #include <string.h> 4 #include <stdio.h> 5 #include <stdlib.h> 6 using namespace std; 7 8 class No 阅读全文

posted @ 2012-06-29 13:28 NULL00 阅读(676) 评论(0) 推荐(0) 编辑

2012年6月28日

POJ 1423 Big Number

摘要: Big NumberDescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.InputInput 阅读全文

posted @ 2012-06-28 14:54 NULL00 阅读(1159) 评论(1) 推荐(1) 编辑

2012年6月26日

POJ 1458 Common Subsequence (最长公共子序列)

摘要: Common SubsequenceDescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another sequence Z = < z1, z2, ..., zk > is a subsequence of X if there exists a strictly increasing sequence < i1 阅读全文

posted @ 2012-06-26 13:50 NULL00 阅读(1616) 评论(0) 推荐(1) 编辑

2012年6月25日

POJ 1019 Number Sequence

摘要: Number SequenceDescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positive integer numbers ranging from 1 to k, written one after another.For example, the fir 阅读全文

posted @ 2012-06-25 14:27 NULL00 阅读(1647) 评论(0) 推荐(0) 编辑

2012年6月22日

POJ 3984 迷宫问题 (Dijkstra)

摘要: 迷宫问题Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示一个迷宫。数据保证有唯一解。Output左上角到右下角的最短路径,格式如样例所示。Sample Input0 1 0 0 00 1 0 1 00 0 0 0 00 1 1 1 00 0 阅读全文

posted @ 2012-06-22 13:57 NULL00 阅读(6503) 评论(1) 推荐(1) 编辑

上一页 1 2 3 4 5 6 ··· 8 下一页

导航