随笔分类 -  算法

摘要:【数据结构与算法C】利用两个栈S1S2模拟一个队列,用栈的基本操作实线EnQueue,DeQueue,QueueEmpty入队列Created with Raphaël 2.1.2开始S2为空出S1入S2入S1yesno出队列Created with Raphaël 2.1.2开始S... 阅读全文
posted @ 2015-04-19 12:32 冰00封 阅读(305) 评论(0) 推荐(0)
摘要:#includeint main(void){ int i,j; int a[11]; int min,temp; printf("enter ten data:\n"); //a[0] = 0; for(i=1;ia[j]) { min = j; } } temp = a[i];... 阅读全文
posted @ 2014-06-12 23:10 冰00封 阅读(104) 评论(0) 推荐(0)
摘要:#include#include#define N 100int main(){ int i,j,n,a[N+1]; for(i=1;i<=N;i++) { a[i] = i; } a[1] = 0; for(i=2;i<sqrt(N);i++) { for(j=i+1;j<=N;j++) {... 阅读全文
posted @ 2014-06-12 23:09 冰00封 阅读(321) 评论(0) 推荐(0)