问题 填空题

[函数2.1说明]
假设两个队列共享一个循环向量空间,其类型Queue2定义如下:
typedef struct
DateType data [MaxSize];
int front[2],rear[2];
Queue2;
对于i=0或1,front[i]和rear[i]分别为第i个队列的头指针和尾指针。函数EnQueue(Queue2 *Q,int i,DateType x)的功能是实现第i个队列的入队操作。
[函数2.1]
int EnQueue(Queue2 *Q,int i,DateType x)
/*若第i个队列不满,则元素x入队列,并返回1,否则返回0*/
if (i<0 || i>1) return 0;
if(Q->rear [i] ==Q->front[ (1) ]) return 0;
Q->data[ (2) ]=x;
Q->rear [i]= (3) ;
return 1;

[函数2.2说明]
函数int BtreeEquaI(BinTreeNode *T1,BinTreeNode *T2)的功能是递归判断两棵二叉数是否相等,若相等则返回1,否则返回0。当两棵树的结构完全相同,并且对应结点的值也相同时才被认为相等。
已知二叉树中的结点类型定义为:
struct BinTreeNode
char data;
BinTreeNode *left,*right;
;
其中data为结点值域,left和right分别为指向左、右子女结点的指针域。
[函数2.2]
int BtreeEqual(BinTreeNode *T1,BinTreeNode *T2)
(if (T1==NULL&&T2==NULL) return 1;
else if ( (4) ) return 0;
else if( (5) ) return 1;
else return 1;

答案

参考答案:Q->rear[i]

完形填空

It was near Christmas during my first semester teaching at a new school. I loved my small special class more than any group I had taught in the past. They were hungry for knowledge and I was enjoying teaching.

Other teachers had told me that our children were from poor families and not to expect any child to bring a Christmas gift. In fact,I wasn't expecting any gifts.

Imagine my surprise when every child brought me a gift on the day before our holiday break. First,I got a much ­loved stuffed monkey from a shy girl. I was told,“He is my favorite,but I love you and I want him to be with you,Miss Taylor.”How thrilled I was!

Next came a new set of Christmas tree lights that was “missing” from a mother's cupboard.

Finally,I came to one little boy's gift which I had never received. It was an old,dirty and broken Christmas story book. Just when I wanted to express my happiness,I was interrupted(打断)by the giver,“And see,it is new!It still has the price tag.”

When other children laughed at him,I stopped them and said,“Oh,books are good in that way. The story is always new if you have not read it before. Now,let's share one together.”Everyone listened quietly as I read the most wonderful Christmas story of my life.

I still keep those Christmas gifts. They always remind me of my lovely kids.

小题1:Why did the teacher like her small special class?

____________________________________________________

小题2:When did the children bring their teacher gifts?

__________________________________________________________

小题3:Who sent a stuffed monkey to the teacher?

_______________________________________________________

小题4:Was the Christmas story book new?

________________________________________________________

小题5:How did the teacher feel when she got the gifts?

_______________________________________________________

单项选择题 A3/A4型题