摘要: 1 #include 2 using namespace std; 3 struct squeue 4 { 5 int data; 6 squeue *next; 7 }; 8 struct link 9 {10 squeue* front;11 squeue ... 阅读全文
posted @ 2015-07-23 16:44 御心飞行 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 using namespace std; 4 #define size 10 5 struct squeue 6 { 7 int queue[size]; 8 int front,rear; 9 };10 void initqu... 阅读全文
posted @ 2015-07-23 16:43 御心飞行 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #define size 10 4 struct squeue 5 { 6 int queue[size]; 7 int front,rear; 8 int flag; 9 };10 void ini... 阅读全文
posted @ 2015-07-23 15:20 御心飞行 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #define queuesize 20 4 struct squeue 5 { 6 int queue[queuesize]; 7 int front,rear; 8 }; 9 void initsqueu... 阅读全文
posted @ 2015-07-23 15:19 御心飞行 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Counting TrianglesTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2506Accepted Submission(s): 1184... 阅读全文
posted @ 2015-07-23 11:29 御心飞行 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 书上的例子 1 #include /*顺序栈*/ 2 using namespace std; 3 #define size 50 4 typedef struct node 5 { 6 int data[size][2]; /*每一层参数+当前返回值*... 阅读全文
posted @ 2015-07-22 20:54 御心飞行 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 利用链栈将中缀表达式转化为后缀表达式,然后利用顺序栈进行扫描计算,返回结果书上的代码 1 #include 2 #include 3 #include 4 #define size 50 5 using namespace std; 6 typedef struct node 7... 阅读全文
posted @ 2015-07-22 13:01 御心飞行 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 余数的序列正好与8进制数字序列相反,利用栈后进先出的特点,用栈来保存 1 #include //带头栈 2 #include 3 using namespace std; 4 typedef struct node 5 { 6 int data; 7 struct node *n... 阅读全文
posted @ 2015-07-21 18:26 御心飞行 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 链栈,写起来还是不熟 1 #include 2 #include 3 using namespace std; 4 typedef struct node 5 { 6 int data; 7 struct node* next; 8 }stacknode,*linkstack;... 阅读全文
posted @ 2015-07-21 17:33 御心飞行 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 共享栈,利用栈的动态性使栈空间能够互相补充,存储空间能够得到有效利用 1 #include 2 using namespace std; 3 #define stacksize 20 4 typedef struct 5 { 6 int stack[stacksize... 阅读全文
posted @ 2015-07-21 16:00 御心飞行 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 书上的 1 #include 2 using namespace std; 3 #define stacksize 10 4 typedef struct /*顺序栈*/ 5 { 6 int stack[stacksize]; 7 int top; ... 阅读全文
posted @ 2015-07-21 15:33 御心飞行 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 书上的题目 链表元素排序,一开始准备交换节点,结果没搞好 1 #include 2 #include 3 using namespace std; 4 typedef struct node 5 { 6 int date; 7 struct node *next; 8 }*lin... 阅读全文
posted @ 2015-07-20 20:40 御心飞行 阅读(416) 评论(2) 推荐(0) 编辑
摘要: 书上题目,取链表交集,放置于另一链表中,使用带头链表 1 #include 2 using namespace std; 3 typedef struct node 4 { 5 int date; 6 struct node *next; 7 }*linklist,listnod... 阅读全文
posted @ 2015-07-20 20:20 御心飞行 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 书上的题目,带头链表&不带头链表不带头链表为空时,判断:head==NULL;带头链表为空是,判断head->next=NULL;但对于链表的插入、删除会有不同,不带头链表对于头节点需要单独处理,而对于带头链表则不需要 1 #include 2 using namespace std; 3 typ... 阅读全文
posted @ 2015-07-20 19:47 御心飞行 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 书上题目,要用带头链表处理 1 #include 2 #include 3 #include 4 using namespace std; 5 typedef struct node 6 { 7 int date; 8 struct node *next; 9... 阅读全文
posted @ 2015-07-20 18:01 御心飞行 阅读(770) 评论(0) 推荐(0) 编辑
摘要: 排名Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18125Accepted Submission(s): 6607Problem Descrip... 阅读全文
posted @ 2015-07-19 10:44 御心飞行 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Eddy's digital RootsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5113Accepted Submission(s): 28... 阅读全文
posted @ 2015-07-19 09:37 御心飞行 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 最少步数时间限制:3000ms | 内存限制:65535KB难度:4描述这有一个迷宫,有0~8行和0~8列:1,1,1,1,1,1,1,1,11,0,0,1,0,0,1,0,11,0,0,1,1,0,0,0,11,0,1,0,1,1,0,1,11,0,0,0,0,1,0,0,11,1,0,1,0,1... 阅读全文
posted @ 2015-07-10 21:34 御心飞行 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 不可以!时间限制:1000ms | 内存限制:65535KB描述判断:两个数x、y的正负性。要求:不可以使用比较运算符,即"","=","==","!="。输入有多组数据,每组数据占一行,每一行两个数x,y。x、y保证在int范围内。输出每组数据输出占一行。如果两个数是一正一负,输出"Signs a... 阅读全文
posted @ 2015-07-09 23:23 御心飞行 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 无主之地1时间限制:1000ms | 内存限制:65535KB难度:0描述子晓最近在玩无主之地1,他对这个游戏的评价不错,结合了FPS与RPG元素,可玩度很高。不过,他发现了一代的任务系统做的不好,任务系统并没有帮他统计清楚哪个区域有多少任务,而且,给任务的时候呢,也比较散乱。比如,在1区域的一个任... 阅读全文
posted @ 2015-07-09 23:12 御心飞行 阅读(243) 评论(0) 推荐(0) 编辑