问题 填空题

如图,轻杆上刻有均匀刻度线,用细线穿过“7”处的小孔后悬挂于固定点O,现将A、B两物体分别挂在“4”和“9”刻度线处时,轻杆恰能保持水平;那么把A挂在______刻度线、B挂在______刻度线也能使轻杆保持水平.

答案

根据杠杆的平衡条件:GA?3L=GB?2L

所以

GA
GB
=
2
3
,根据杠杆的平衡条件,要使杆平衡应满足
LA
LB
=
3
2

所以A可以挂在1的位置,此时力臂为6,B挂在11,此时力臂为4.

故答案为:1;11.

问答题

【说明】 散列文件的存储单位称为桶(BUCKET)。假如一个桶能存放m个记录,当桶中已有m个同义词(散列函数值相同)的记录时,存放第m+1个同义词会发生“溢出”。此时需要将第m+1个同义词存放到另一个称为“溢出桶”的桶中。相对地,称存放前m个同义词的桶为“基桶”。溢出桶和基桶大小相同,用指针链接。查找指定元素记录时,首先在基桶中查找。若找到,则成功返回,否则沿指针到溢出桶中进行查找。 例如:设散列函数为Hash(Key)=Key mod 7,记录的关键字序列为15,14,21,87,96, 293,35,24,149,19,63,16,103,77,5,153,145,356,51,68,705,453,建立的散列文件内容如图5-3所示。

为简化起见,散列文件的存储单位以内存单元表示。 函数InsertToHashTable(int NewElemKey)的功能是;若新元素NewElemKey正确插入散列文件中,则返回值1;否则返回值0。 采用的散列函数为Hash(NewElemKey)=NewElemKey % P,其中P为设定的基桶数目。 函数中使用的预定义符号如下: #define NULLKEY-1 /*散列桶的空闲单元标识*/ #define P 7/*散列文件中基桶的数目*/ #define ITEMS 3 /*基桶和溢出桶的容量*/ typedef struet BucketNode{/*基桶和溢出桶的类型定义*/int KeyData[ITEMS];struct BucketNode *Link; }BUCKET; BUCKET Bucket[P]; /*基桶空间定义*/【函数5-3】 int InsertToHashTable(int NewElemKey){ /*将元素NewElemKey插入散列桶中,若插入成功则返回0,否则返回-1*/ /*设插入第一个元素前基桶的所有KeyData[],Link域已分别初始化为NULLKEY、NULL*/ int Index; /*基桶编号*/ int i,k’ BUCKET *s,*front,*t; (1) ; for(i=0;i<ITEMS;i++) /*在基桶查找空闲单元,若找到则将元素存入*/if(Bucket[Index].KeyData[i]==NULLKEY){ Bucket[Index].KeyData[i]=NewElemKey; break;} if( (2) )return 0; /* 若基桶已满,则在溢出桶中查找空闲单元,若找不到则申请新的溢出桶*/ (3) ; t=Bucket[Index].Link; if(t!=NULL){ /*有溢出桶*/while(t!=NULL){ for(k=0;k<ITEMS;k++) if(t->KeyData[k]==NULLKEY){/* 在溢出桶链表中找到空闲单元*/t->KeyData[k]=NewElemKey;break; }/*if*/ front=t; if( (4) )t=t->Link; else break;}/*while*/ }/*if*/ if( (5) ){ /* 申请新溢出桶并将元素存入*/ s=(BUCKET *)malloc(sizeof(BUCKET)); if(!s)retum -1; s->Link=NULL; for(k=0;k<ITEMS;k++) s->KeyData[k]=NULLKEY; s->KeyData[0]=NewElemKey; (6) ; }/*if*/ return 0; }/*InsertToHashTable*/

阅读理解
阅读下文,从所给的四个选项中选出一个最佳答案。
        We have always been interested in the moon. 2000 years ago people already knew it moved around the
earth and where it would be in the sky at different times of the year. At that time, everything about the moon
was learned by watching it carefully in the sky.   
        When scientists could use telescopes to study the moon more closely, their ideas began to change. They
could see the moon was made of rocks. Most scientists thought moon rocks would be different from those on
Earth. This was because they believed the moon had once been a planet that had been caught in the earth's
gravity (引力) millions of years earlier.   
         In 1969 moon rocks were finally brought to the earth and studied. Much to their surprise, scientists
found that, except for water, the moon and the earth were made of the same things. Once again new ideas
were needed for this new information.   
         After years of study, most scientists now think that the moon was once part of Earth. They believe very
early in its history, maybe 4 million years ago, something about the size of Mars hit Earth. This sent billions of
rocks into space around our planet. These rocks slowly joined together and after many years became the moon.
In the future, even though our ideas about the moon may change again, we will still be interested in it.
1. Now, we're sure _________
[ ]
A. Moon rocks are quite different from those on Earth.
B. Moon was once a part of Earth.
C. Moon moves around Earth and it's the only satellite of Earth.
D. Moon was once a planet caught in Earth's gravity.
2. In 1969 there is a big event, that is __________.
[ ]
A. humans Found no water in Moon rocks
B. scientists made out a modern spaceship
C. scientists invented an advanced telescope
D. humans left their footprints on Moon
3. What does the writer want to tell us in the passage?
[ ]
A. Why people are interested in the moon.
B. How ideas about the moon have changed over time.
C. Where the moon came from in the past.
D. That people have finally learned the truth about the moon.
4. Before 1969 most scientists thought the moon was ________.
[ ]
A. part of the earth billions of years earlier
B. older than the earth
C. a planet caught by the earth's gravity
D. made of the same things as the earth
5. From this passage we can learn that ________.
[ ]
A. scientists in the past were not clever
B. the earth was once part of the moon
C. new information brings new ideas
D. we now know everything about the moon