摘要:
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;... 阅读全文
摘要:
------- 阅读全文
摘要:
------- 阅读全文
摘要:
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 {... 阅读全文
摘要:
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 //-------... 阅读全文