摘要: Shell编程一.for循环生成列表 {起始数..结束数}命令生成列表 `seq [起始数] [步进长度] 结束数 ` for l in {1..5};do for l in `seq 5`;do求1到100的累加和1 #!/bin/bash2 declare -i SUM=03 4 for l ... 阅读全文
posted @ 2014-11-24 22:51 晓风_7 阅读(2017) 评论(0) 推荐(0) 编辑
摘要: 题目: Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2). You are given a targe... 阅读全文
posted @ 2014-11-10 12:27 晓风_7 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 题目:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not poss... 阅读全文
posted @ 2014-11-02 21:12 晓风_7 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 本章主要介绍了线程,了解如何使用多线程在单进程环境中来执行多任务。由于多个线程共享其进程空间,所以必须采用同步的机制来保护数据的一致性。一.线程的概念 典型的Unix系统都可以看成只有一个控制线程,一个进程在同一时刻只能做一件事。但有了多线程,我们可以设计成在同一时刻进程能做不止一件事,每个... 阅读全文
posted @ 2014-10-24 11:49 晓风_7 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 本章主要介绍了c++类中成员变量、函数对象的在内存中布局. 当c++类中不包含virtual机制类的函数时,内部nostatic member被包含在每一个class object之中,就想c struct一样,而member function虽然含在class声明之内,却不出现在object之中... 阅读全文
posted @ 2014-10-23 16:46 晓风_7 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题目:You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concaten... 阅读全文
posted @ 2014-10-21 22:49 晓风_7 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 大多数UNIX应用程序都使用I/O库,本章说明了该库所包含的所有函数,以及某些实现细节和效率方面的考虑。同时需要重点关注标准I/O使用了缓冲的技术,但同时也是因为它的出现,产生了很多细节上的问题.流和FILE对象 unix系统调用的函数都是针对文件描述符操作的.而标准I/O库,它们的操作则是围... 阅读全文
posted @ 2014-10-19 17:22 晓风_7 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 题目:Divide two integers without using multiplication, division and mod operator.思路分析二分法.将除数不断增倍,而结果同样扩大两倍,直到除数的值大于被除数.然后再利用被除数减去除数最后增长到小于被除数的值,递归求出结果.例... 阅读全文
posted @ 2014-10-19 00:27 晓风_7 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo... 阅读全文
posted @ 2014-10-10 17:30 晓风_7 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a... 阅读全文
posted @ 2014-10-09 22:16 晓风_7 阅读(141) 评论(0) 推荐(0) 编辑