各种基本算法实现小结(二)—— 堆 栈(均已测试通过)==============================================================栈——数组实现测试环境:VS 2010 1 #include 2 char stack[512]; 3 int top=0; 4 void push(char c) 5 { 6 stack[top]=c; 7 top++; 8 } 9 char pop() 10 { 11 ... Read More
posted @ 2014-03-07 19:16 风华一指流砂,苍老一段年华 Views(256) Comments(0) Diggs(0) Edit
各种基本算法实现小结(一)—— 单链表(均已测试通过)单链表(测试通过) 测试环境:VS 2010 1 #include 2 struct _node 3 { 4 int data; 5 struct _node *next; 6 }; 7 typedef struct _node list; 8 void display(list *l) 9 { 10 list *p; 11 p=l; 12 while(p->next... Read More
posted @ 2014-03-07 11:37 风华一指流砂,苍老一段年华 Views(193) Comments(0) Diggs(0) Edit