摘要: 1 #include "iostream" 2 using namespace std; 3 4 #define MAXLENGTH 20 5 typedef struct Queue 6 { 7 int array[MAXLENGTH]; 8 //first指向将要被删除的元素的下标,tail指向可以被插入元素的位置 9 int first,tail; 10 }Queue; 11 12 void initial(Queue *queue) 13 { 14 queue->first = 0; 15 queue->tail = 0;... 阅读全文
posted @ 2013-09-04 17:06 Big.Eagle 阅读(218) 评论(0) 推荐(0) 编辑
摘要: ------- 阅读全文
posted @ 2013-09-04 15:22 Big.Eagle 阅读(131) 评论(0) 推荐(0) 编辑
摘要: ------- 阅读全文
posted @ 2013-09-04 15:21 Big.Eagle 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #define STACKLENGTH 20 4 typedef struct Stack 5 { 6 int s[STACKLENGTH]; 7 int t; 8 }Stack; 9 10 void initial(Stack *stack) 11 { 12 //第一个元素舍去不用 13 stack->s[0] = 0; 14 stack->t = 0; 15 } 16 //入栈 17 bool push(Stack *stack,int elem) 18 {... 阅读全文
posted @ 2013-09-04 15:17 Big.Eagle 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #define MAXLENGTH 20 4 5 typedef struct LineList 6 { 7 int Array[MAXLENGTH]; 8 int curLength; 9 }LineList; 10 11 bool initial(LineList* elem) 12 { 13 elem->Array[0] = 0; 14 elem->curLength = 0; 15 return true; 16 } 17 18 //-------... 阅读全文
posted @ 2013-09-04 14:18 Big.Eagle 阅读(225) 评论(0) 推荐(0) 编辑