ArrStack——数组栈(procedure)
摘要:
//数组栈,对于无法预料栈的长度情况下,可能会因为原分配数组不够长而导致数据溢出,或因为数组太长而浪费空间。但是操作快,不需要额外的操作。而链表与此想法,可以动态分配内存,但是要增加额外的操作。 #include #include #include "stack.h"int main() { int i; Type x; STACK *s = NULL; Type arr[] = {3,1,2,5,7,9};s = CreateStack(10); if(s == NULL) return -1;for(i = 0; i #include #include "st 阅读全文
浙公网安备 33010602011771号