摘要: -fPIC-fPIC 作用于编译阶段,告诉编译器产生与位置无关代码(Position-Independent Code), 则产生的代码中,没有绝对地址,全部使用相对地址,故而代码可以被加载器加载到内存的任意 位置,都可以正确的执行。这正是共享库所要求的,共享库被加载时,在内存的位置不是固定的。... 阅读全文
posted @ 2015-10-23 10:56 Bouygues 阅读(377) 评论(0) 推荐(0) 编辑
摘要: pc 程序计数器, 指向当前指令的下条指令的地址lr 链接寄存器, 程序调用返回地址sp 指向当前的栈块(chunk)限制,或它的上面。这是用于复制临时数据、寄存器和类似的东西到其中的地方。(堆栈指针)fp 要么是零,要么指向回溯结构的最当前的部分。ip 内部过程调用寄存器LR (R14) link... 阅读全文
posted @ 2015-10-16 18:00 Bouygues 阅读(581) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int Arr[10] = { 1,2,3,4,5 };int select[10];int index = 0;/*common func*/void swap(int a, int b){ int c = Arr[a]; ... 阅读全文
posted @ 2015-09-01 18:58 Bouygues 阅读(227) 评论(1) 推荐(0) 编辑
摘要: Bellman-Ford算法由美国数学家理查德•贝尔曼(Richard Bellman, 动态规划的提出者)和小莱斯特•福特(Lester Ford)发明。适用范围:- 有向图,无向图(需把edge重复2遍); 即对于边w(u, v),存储2遍: w(u,v), w(v,u);- 适用于从图中某个... 阅读全文
posted @ 2015-08-31 18:03 Bouygues 阅读(672) 评论(0) 推荐(1) 编辑
摘要: 公司成天坑爹考试;不过我下个月才考。闲来无事,写个算法玩玩。PS,公司坑爹,不让用stl;所以用一个数组来替代stl::stack。++++++++++++++++++++++++++++++++++++#无向图无向图比较简单,只需要用一个辅助的Visit 数据记录点是否被访问过即可。#includ... 阅读全文
posted @ 2015-07-21 16:59 Bouygues 阅读(645) 评论(0) 推荐(0) 编辑
摘要: 1. 安装Windows客户端https://github.com/xxxx2. Create Git Repo3. 建议设置 git bash 为 terminal 4. git config --listgit config –-global http.proxy http://127.0.0.... 阅读全文
posted @ 2015-05-18 16:31 Bouygues 阅读(1405) 评论(0) 推荐(0) 编辑
摘要: 对于给定的两个集合,使用哈希表可以在线性时间复杂度内得到他们的交集和并集,具体说明如下:假设有集合A={1, 7, 5, 13, 9, 10, 11}, B={5, 7, 10, 1, 18, 12},1)求交集,需要得到结果:A∩B={1, 5, 7,10} 思路如下: ①建立一个哈希表(Hash... 阅读全文
posted @ 2015-05-04 15:53 Bouygues 阅读(2440) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example, S ... 阅读全文
posted @ 2015-03-31 16:57 Bouygues 阅读(275) 评论(0) 推荐(0) 编辑
摘要: IPC进程间通信(Inter-Process Communication)就是指多个进程之间相互通信,交换信息的方法。Linux IPC基本上都是从Unix平台上继承而来的。主要包括最初的Unix IPC,System V IPC以及基于Socket的IPC。另外,Linux也支持POSIX IPC... 阅读全文
posted @ 2014-10-31 09:45 Bouygues 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 文件属性和权限[root@daf root]# ls -altotal 64drwxr-x--- 4 root root 4096 Feb 14 22:02 .drwxr-xr-x 23 root root 4096 Feb 16 13:35 ..-rw-r--r-- 1 root root 121... 阅读全文
posted @ 2014-02-14 15:50 Bouygues 阅读(181) 评论(0) 推荐(0) 编辑