听力原文:Man: John Woods here, phoning about the project we discussed earlier. Could you give me a ring so that we can talk about it a bit more? I've done a few calculations and I'm beginning to wonder whether it's really a practical proposition. I still think the project's got potential, but there are significant additional costs which we hadn't taken into account. So could you get back to me as soon as you can, please?
(21)
查看答案
“社会人”假设认为()对于激发动机、调动职工的积极性是比()更为重要的因素。
阅读以下说明和C语言函数,将应填入(n)处的字句写在答题纸的对应栏内。
[说明]
求树的宽度,所谓宽度是指在二叉树的各层上,具有结点数最多的那一层的结点总数。本算法是按层次遍历二叉树,采用一个队列q,让根结点入队列,若有左右子树,则左右子树根结点入队列,如此反复,直到队列为空。
[函数]
int Width (BinTree *T
{
int front=-1, rear=-1; /*队列初始化*/
int flag=0, count=0, p; /*p用于指向树中层的最右边的结点, flag 记录层中结点数的最大值*/
if (T!=Null)
{
rear++;
(1);
flag=1;
p=rear;
}
while ((2))
{
front++;
T=q [front]];
if (T->lchild!=Null )
{
roar+-+;
(3);
count++;
}
if (T->rchild!=Null )
{
rear++; q[rear]=T->rchild;
(4);
}
if (front==p ) // 当前层已遍历完毕
{
if((5))
flag=count;
count=0;
p=rear, //p 指向下一层最右边的结点
}
}
return (flag );
}