欢迎来到天天文库
浏览记录
ID:28244868
大小:84.50 KB
页数:19页
时间:2018-12-08
《中兴笔试+面试题目》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、中兴笔试+面试题目面试,中兴1>某人在某个市场某个商家买了某台电脑,请用你熟悉的计算机语言表达出里面的关系.其中有商家类,买家类,商品类。还要有买方法,卖方法。2>一个完整的单例模式3>曹操南下攻打刘备,刘备派关羽守锦州,关羽派张飞去守城门。刘备又派诸葛亮去向孙权求援。孙权派兵攻打曹操!请画出UML图2006年12月中兴在我们学校的笔试,最后的大题
2、dio.h>#defineN11/*用监视哨查找*/intsearch(intarray[],intn,intk){inti;i=n-1;array[0]=k;while(array!=k)i--;return(i);}/*折半查找法*/inthalfsearch(intarray[],intn,intk){inti,j,mid;i=1;j=n;while(i<=j){mid=(i+j)/2;if(k==array[mid])return(mid);elseif(k3、-1;elsei=mid+1;}return(0);}/*冒泡排序法*/voidmpsort(intarray[]){inti,j,a;a=0;for(i=1;iarray[j]){a=array;array=array[j];array[j]=a;}}/*直接插入排序*/voidinsertsort(intarray[]){inti,j;for(i=2;i4、ay[0]5、,array);printf("");}main(){inta[11],i,x,chang;/*printf("enterthearray");for(i=1;i<11;i++)scanf("%d",&a);*/aga:printf("chang:1:usewatchingmethodfinding2:usehalfmethodfinding3:usedirectnessintsertmethodsort4:usebubbleupmethodsort5:exit");6、scanf("%d",&chang);switch(chang){case1:{creat(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);printf("Thenumberstationis:%d",search(a,N,x));gotoaga;}case2:{creat(a);insertsort(a);print(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);p7、rintf("Thenumberstationis:%d",halfsearch(a,N,x));gotoaga;}case3:{creat(a);insertsort(a);print(a);gotoaga;}case4:{creat(a);mpsort(a);print(a);gotoaga;}case5:{printf("exit!");break;}default:{printf("Error!");gotoaga;}}}二、线性链表的存储实现structLNODE{ElemTy8、pedata;structLNODE*next;};typedefstructLNODELNode;typedefstructLNODE*LinkList;1初始化操作StatusInit_L(LinkListL){if(L=(LinkList*)malloc(sizeof(LNode))){L->next=NULL;return1;}elsereturn0;}2插入操作StatusListInsert_L(LinkList&L,inti,ElemTypee){p=L
3、-1;elsei=mid+1;}return(0);}/*冒泡排序法*/voidmpsort(intarray[]){inti,j,a;a=0;for(i=1;iarray[j]){a=array;array=array[j];array[j]=a;}}/*直接插入排序*/voidinsertsort(intarray[]){inti,j;for(i=2;i4、ay[0]5、,array);printf("");}main(){inta[11],i,x,chang;/*printf("enterthearray");for(i=1;i<11;i++)scanf("%d",&a);*/aga:printf("chang:1:usewatchingmethodfinding2:usehalfmethodfinding3:usedirectnessintsertmethodsort4:usebubbleupmethodsort5:exit");6、scanf("%d",&chang);switch(chang){case1:{creat(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);printf("Thenumberstationis:%d",search(a,N,x));gotoaga;}case2:{creat(a);insertsort(a);print(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);p7、rintf("Thenumberstationis:%d",halfsearch(a,N,x));gotoaga;}case3:{creat(a);insertsort(a);print(a);gotoaga;}case4:{creat(a);mpsort(a);print(a);gotoaga;}case5:{printf("exit!");break;}default:{printf("Error!");gotoaga;}}}二、线性链表的存储实现structLNODE{ElemTy8、pedata;structLNODE*next;};typedefstructLNODELNode;typedefstructLNODE*LinkList;1初始化操作StatusInit_L(LinkListL){if(L=(LinkList*)malloc(sizeof(LNode))){L->next=NULL;return1;}elsereturn0;}2插入操作StatusListInsert_L(LinkList&L,inti,ElemTypee){p=L
4、ay[0]5、,array);printf("");}main(){inta[11],i,x,chang;/*printf("enterthearray");for(i=1;i<11;i++)scanf("%d",&a);*/aga:printf("chang:1:usewatchingmethodfinding2:usehalfmethodfinding3:usedirectnessintsertmethodsort4:usebubbleupmethodsort5:exit");6、scanf("%d",&chang);switch(chang){case1:{creat(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);printf("Thenumberstationis:%d",search(a,N,x));gotoaga;}case2:{creat(a);insertsort(a);print(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);p7、rintf("Thenumberstationis:%d",halfsearch(a,N,x));gotoaga;}case3:{creat(a);insertsort(a);print(a);gotoaga;}case4:{creat(a);mpsort(a);print(a);gotoaga;}case5:{printf("exit!");break;}default:{printf("Error!");gotoaga;}}}二、线性链表的存储实现structLNODE{ElemTy8、pedata;structLNODE*next;};typedefstructLNODELNode;typedefstructLNODE*LinkList;1初始化操作StatusInit_L(LinkListL){if(L=(LinkList*)malloc(sizeof(LNode))){L->next=NULL;return1;}elsereturn0;}2插入操作StatusListInsert_L(LinkList&L,inti,ElemTypee){p=L
5、,array);printf("");}main(){inta[11],i,x,chang;/*printf("enterthearray");for(i=1;i<11;i++)scanf("%d",&a);*/aga:printf("chang:1:usewatchingmethodfinding2:usehalfmethodfinding3:usedirectnessintsertmethodsort4:usebubbleupmethodsort5:exit");
6、scanf("%d",&chang);switch(chang){case1:{creat(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);printf("Thenumberstationis:%d",search(a,N,x));gotoaga;}case2:{creat(a);insertsort(a);print(a);printf("Pleaseintthesearchnumber:");scanf("%d",&x);p
7、rintf("Thenumberstationis:%d",halfsearch(a,N,x));gotoaga;}case3:{creat(a);insertsort(a);print(a);gotoaga;}case4:{creat(a);mpsort(a);print(a);gotoaga;}case5:{printf("exit!");break;}default:{printf("Error!");gotoaga;}}}二、线性链表的存储实现structLNODE{ElemTy
8、pedata;structLNODE*next;};typedefstructLNODELNode;typedefstructLNODE*LinkList;1初始化操作StatusInit_L(LinkListL){if(L=(LinkList*)malloc(sizeof(LNode))){L->next=NULL;return1;}elsereturn0;}2插入操作StatusListInsert_L(LinkList&L,inti,ElemTypee){p=L
此文档下载收益归作者所有