选择题:●试题三 阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。 【说明】 设有一

  • 题目分类:软考初级
  • 题目类型:选择题
  • 查看权限:VIP
题目内容:
●试题三

阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。

【说明】

设有一个带表头结点的双向循环链表L,每个结点有4个数据成员:指向前驱结点的指针prior、指向后继结点的指针next、存放数据的成员data和访问频度freq。所有结点的freq初始时都为0。每当在链表上进行一次L.Locate(x)操作时,令元素值x的结点的访问频度freq加1,并将该结点前移,链接到现它的访问频度相等的结点后面,使得链表中所有结点保持按访问频度递减的顺序排列,以使频繁访问的结点总是靠近表头。

【函数】

void Locate(int &x)

{<结点类型说明>

*p=first->next;

while(p!=frist && (1) )P=P->next;

if (p!=first)/*链表中存在x*/

{ (2) ;

<结点类型说明>

*current=p;/*从链表中摘下这个结点*/

Current->prior->next=current->next;

Current->next->prior=current->prior;

P=current->prior;/*寻找重新插入的位置*/

While(p!=first && (3) )p=p->prior;

Current->next= (4) ;/*插入在P之后*?

Current->prior=P;

P->next->prior=current;

P->next= (5) ;

}

else printf("Sorry.Not find!\n");/*没找到*/

}




参考答案:

●A highlevel language is an artificial language with which we can write various (71) .(71

●A highlevel language is an artificial language with which we can write various (71) .(71

查看答案

●A user interface can be defined as the combination of hardware and software that helps pe

●A user interface can be defined as the combination of hardware and software that helps pe

查看答案

●试题四 阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。 【说明】 函数Qui

●试题四 阅读下列函数说明和C代码,将应填入(n)处的字句写在答题纸的对应栏内。 【说明】 函数Qui

查看答案

●In document windows,selected text is (73) .(73) A.copied B.inserted C.deleted D.highlight

●In document windows,selected text is (73) .(73) A.copied B.inserted C.deleted D.highlight

查看答案

● 在Windows 操作系统中, “ (24) ”是内存的一块区域,用于各个应用程序之间相互交换信息。(24)A.

● 在Windows 操作系统中, “ (24) ”是内存的一块区域,用于各个应用程序之间相互交换信息。(24)A.

查看答案