码迷,mamicode.com
首页 >  
搜索关键字:递归 return    ( 77935个结果
linux命令
1、文件目录操作 pwd:显示当前目录 cd:目录跳转 ls:-a—全部;-l—列举目录;-F--文件类型;-r--逆向(从后向前);-R--递归;-S--大小 locate:查找文件或目录 clear:清除终端窗口 cat:显示文件内容 head:查看文件开头部分 ...
分类:系统相关   时间:2014-07-22 23:14:53    阅读次数:708
shell脚本遍历目录及其下子目录
用shell写了个递归遍历目录的脚本,本脚本实现递归遍历指定目录,打印目录下的文件名(全路径)。#!/bin/sh function scandir() { local cur_dir parent_dir workdir workdir=$1 cd ${workdir} if [ ${w...
分类:其他好文   时间:2014-07-22 23:14:53    阅读次数:563
c#用反射原理递归遍历复杂实体对象
之前在网上看到的都是遍历那种比较简单的实体对象,但是如果有实体嵌套,甚至是包含有List这种属性的时候就没有办法处理了。通过递归遍历的方式可以完成对复杂实体对象的所有属性的遍历,可以取值和赋值。下面是关键部分的代码,有什么不对的地方路过的大大一定要指点哈。using System.Reflectio...
分类:其他好文   时间:2014-07-22 23:14:34    阅读次数:493
山东省第三届acm
#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
[HDU 1166 敌兵布阵] 线段树 或 树状数组
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
20140429
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
javascript学习6-练习之3二分查找算法
二分查找算法,对数据进行查找并且显示位置。核心思想:将所查找数据与查询数组中间的数进行比较,findValrightIndex) 8 { 9 // 提示找不到,防止无穷递归10 document.write("找不到");11 retur...
分类:编程语言   时间:2014-07-22 23:09:35    阅读次数:304
LeetCode OJ - Word Ladder
我觉得这道题比较难,主要是因为对于我来说:1. 我没有把这个问题联想到树的宽度遍历(即便没有考虑树的宽度遍历,也是可以做的,但是我一开始实现的代码却是深度遍历,后来发现树的BFS一般使用queue实现的,貌似没有递归的方法??)2. 即使在意识到用BFS,却还有一个陷阱:我是对字典进行了BFS,这个...
分类:其他好文   时间:2014-07-22 23:08:55    阅读次数:305
Palindrome Partitioning
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!