问题 填空题

阅读以下说明、图和C代码,将应填入 (n) 处的字句写在对应栏内。

[说明]

一般的树结构常采用孩子一兄弟表示法表示,即用二叉链表作为树的存储结构,链表中结点的两个链域分别指向该结点的第一个孩子结点和下一个兄弟结点。例如,如图21-6(a)所示的树的孩子一兄弟表示如图21-6(b)所示。

函数LevelTraverse0的功能是:对给定树进行层序遍历。例如,对如图21-6(a)所示的树进行层序遍历时,结点的访问次序为:D B A E F P C。

对树进行层序遍历时使用了队列结构,实现队列基本操作的函数原型如表21-1所示。

Bool、Status类型定义如下:

typedef enum(FALSE=0,TRUE=1)Bool;

typedef enum(OVERFLOW=-2,UNDERFLOW=-1,ERROR=0,OK=1)Status;树 的二叉链表结点定义如下:

typedef struct Node

char data;

struct Node *fimstchild,*nextbrother;

Node,*TreeNode;

[本题函数]

Status LeveiTraverse(TreeNode root)

/*层序遍历树,树采用孩子一兄弟表示法,root是树根结点的指针*/

Queue temQ;

TreeNode ptr,brotherptr;

if(!root)

return ERROR;

InitQueue(&tempQ);

(1)

brotherptr=root->nextbrother;

while(brotherptr)

EnQueue(&tempQ,brotherptr);

(2)

/-end-while*/

while( (3) )

(4)

printf("%c\t",ptr->data);

if( (5) )continue;

(6)

brotherptr=ptr->firstchild->nextbrother;

while (brotherptr)

EnQueue(&tempQ,brotherptr);

(7)

/*end-while*/

/*end-while*/

return OK;

/*LevelTraverse*/

(3)处填()。

答案

参考答案:!IsEmpty(tempQ)

选择题
完形填空

SECTION B (18 points)

Directions:For each blank in the following passage there are four words or phrases marked with A, B, C and D. Fill in each blank with the words or phrases that best fits the context.

People have always enjoyed laughing, and there has always been humor. One of the most well-known and well-loved types of comedy is called   36 . Stand-up comedy is special   37   the comedian is right there in front of the audience and may talk directly to audience members. A stand-up comedian may make fun of an audience member, or he or she might decide to tell different jokes   38  the reactions of an audience.

There are different styles of stand-up comedy. The main four are observational(观察评论类), prop(道具使用类), physical(形体动作类) and impressionist(印象模仿类) . In observational comedy, the comedian makes jokes about humorous things he or she    39   in everyday life. If you hear a comedian telling jokes about the way   40   people behave when they queue up in lines, or asking why it only rains when you forget your   41 , you are listening to an observational comedian. Prop comedians use things, called   42 , to tell their jokes. The jokes are not funny if you cannot see the prop. It is a type of visual humor. If a comedian points to a   43   tennis game and says, “I’ve been playing tennis   44  for a month. I don’t understand why I am not losing   45 !”, he or she is using the computer as a prop. Physical comedians use their bodies to make jokes. They have been   46  chairs, walking into doors, and falling down on stage for years. The last style is called   47 . These comedians act or speak like a well-known person. This is called doing an impression of the person.

36. A. prop           B. comedy       C. stand-up            D. comedian

37. A. because of               B. because         C. although          D. as if

38. A. in honor of         B. in order to     C. in case of           D. in response to

39. A. watch           B. observe        C. see                D. find

40. A. /                   B. in that          C. how               D. which

41. A. coat                B. wallet          C. umbrella           D. sunglasses

42. A. queues            B. humor        C. impression        D. props

43. A. funny           B. boring        C. computer                D. new

44. A. every day       B. everyday      C. some times        D. sometimes

45. A. weigh         B. weight          C. overweight         D. weight-loss

46. A. running after          B. fighting against C. competing with      D. tripping over

47. A. impressionist      B. prop               C. physical            D. observational