摘要:1、I was worried that my work wasn’t good enough, but the teacher A me that the work would be satisfactory.A assured B ensured C reassured D confirmed2、Their qualification C the to a high salary.A rewards B grants C entitles D awards3、No task is so difficult C A that we can accomplish it B as to be u
阅读全文
摘要:原题:设有一大批需要实时处理的数据元素组成集合s,需要实时处理开始后,每隔一极小的时间间隔便收到一个新的数据元素加入s。现要求在每次接收一个新元素之前,找出s中现有的最小元素并将其输出(从s中删除)。试选择或构造一种适当的数据结构并设计一个算法,尽可能高效地完成上述任务。
阅读全文
摘要:void DFS(ALGraph G, int v,int m,int k) { // 从第v个顶点出发递归地深度优先遍历图G。 int w; visited[v] = true;for (w=FirstAdjVex(G, v); (w!=0)&&(m<k); w=NextAdjVex(G, v, w)) if (!visited[w]) // 对v的尚未访问的邻接顶点w递归调用DFS { printf("%d",w); m++; DFS(G, w,m,k); m--; }}
阅读全文
摘要:Void exit_path(ALGraph G, int v0 , int k){visited[v0]=TRUE;If(k<=0)return;Else{For(p=G.vertices[v0]; p; p=p->next){m=p->adjvex;If(!visited[m]){visited[m]= TRUE;printf(“%d”, m);exit_path(G , m,k-1);}}}}
阅读全文
摘要:intbalance(BiTree T){if(!T)return 0;d1=balance(T->lchild)+1;d2=balance(T->rchild)+1;printf(T->data);printf("%d",fabs(d1-d2));if(d1>d2)return d1;else return d2;}有问题请留言。
阅读全文
摘要:STATUS normaltree(Bitree *bt){if(!bt)return TRUE;if(bt->lchild&&bt->rchild){if(normaltree(bt->lchild))if(normaltree(bt->rchild))return TRUE;return FALSE;}elseif((bt->lchild==null)&&(bt->rchild==null))return TRUE;elsereturn FALSE;}有疑问可以交流。
阅读全文