1、文件目录操作 pwd:显示当前目录 cd:目录跳转
ls:-a—全部;-l—列举目录;-F--文件类型;-r--逆向(从后向前);-R--递归;-S--大小 locate:查找文件或目录 clear:清除终端窗口
cat:显示文件内容 head:查看文件开头部分 ...
分类:
系统相关 时间:
2014-07-22 23:14:53
阅读次数:
708
用shell写了个递归遍历目录的脚本,本脚本实现递归遍历指定目录,打印目录下的文件名(全路径)。#!/bin/sh function scandir() {
local cur_dir parent_dir workdir workdir=$1 cd ${workdir} if [ ${w...
分类:
其他好文 时间:
2014-07-22 23:14:53
阅读次数:
563
之前在网上看到的都是遍历那种比较简单的实体对象,但是如果有实体嵌套,甚至是包含有List这种属性的时候就没有办法处理了。通过递归遍历的方式可以完成对复杂实体对象的所有属性的遍历,可以取值和赋值。下面是关键部分的代码,有什么不对的地方路过的大大一定要指点哈。using
System.Reflectio...
分类:
其他好文 时间:
2014-07-22 23:14:34
阅读次数:
493
#include #include using namespace std;int
s[4],p[4];long long llmax(long long a,long long b){ return a>b?a:b;}int
main(){ int t; cin>>t; int c=1; whil...
分类:
其他好文 时间:
2014-07-22 23:13:54
阅读次数:
307
1 #include 2 #include 3 #include 4 using namespace
std; 5 int n,C[50005]; 6 //-------------------------- 7 int lowbit(int x){ 8
return x&-x; 9 }1...
分类:
其他好文 时间:
2014-07-22 23:12:33
阅读次数:
311
1、单链表循环体用while(p->next!=NULL)而不用while(p!=NULL)的原因 node *Find_MidNode(node
*head){ if(head->next==NULL||head->next->next==NULL) return
head->next; node...
分类:
其他好文 时间:
2014-07-22 23:11:15
阅读次数:
374
题目: 如数: 1 1 2 3 5 8 13 21 34 55 ......序号: 0 1 2
3 4 5 6 7 89 ...... 由用户输入序号,输出对应的数值。效果:实现代码:#include int bian(int num);//static
int shu[100]={1,1};int...
分类:
其他好文 时间:
2014-07-22 23:10:13
阅读次数:
353
二分查找算法,对数据进行查找并且显示位置。核心思想:将所查找数据与查询数组中间的数进行比较,findValrightIndex) 8 { 9 //
提示找不到,防止无穷递归10 document.write("找不到");11 retur...
分类:
编程语言 时间:
2014-07-22 23:09:35
阅读次数:
304
我觉得这道题比较难,主要是因为对于我来说:1.
我没有把这个问题联想到树的宽度遍历(即便没有考虑树的宽度遍历,也是可以做的,但是我一开始实现的代码却是深度遍历,后来发现树的BFS一般使用queue实现的,貌似没有递归的方法??)2.
即使在意识到用BFS,却还有一个陷阱:我是对字典进行了BFS,这个...
分类:
其他好文 时间:
2014-07-22 23:08:55
阅读次数:
305
Given a strings, partitionssuch that every
substring of the partition is a palindrome.Return all possible palindrome
partitioning ofs.For example, giv...
分类:
其他好文 时间:
2014-07-22 23:08:15
阅读次数:
446