填空题

在最坏情况下,冒泡排序所需要的比较次数为 【1】 。

【参考答案】

n(n-1)/2
<上一题 目录 下一题>
热门 试题

单项选择题
(48)~(50)以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请从与下划线处号码对应的一组选项中选择出正确的选项。#include <stdlib.h>struct node{ char data; struct node *next;};(48) CreatList(char *s){ struct node *h,*p,*q;h=(struct node *)malloc(sizeof(Struct node));p=q=h;while(*s!=‘ 0’){ p=(struct node *)malloc(sizeof(struct node));p->data=(49);q->next=p;q=(50);s++;}p->next=0;return h;}main(){ char str[]= link list ;struct node *head;head=CreatList(str);}
A.char*
B.stmct node
C.strumnode*
D.char
单项选择题
有以下程序: struct STU{ char name[10]; int num; }; void f1(struct STU c) { struct STU b={ LiSiGuo ,2042); c=b; } void f2(struct STU *c) { struct STU b={ SunDan ,2044); *c=b; } main() {struct STU a={ YangSan ,2041},b={ WangYin ,2043); f1(a);f2(&b); printf( %d %d n ,a.num,b.num); } 执行后输出结果是( )。
A.2041 2044
B.2041 2043
C.2042 2044
D.2042 2043
相关试题
  • 以下程序的功能是将字符串s中的数字字符放...
  • 已有定义如下:struct node{ int data...
  • 以下程序运行后的输出结果是 【13】 。...
  • 以下程序运行后的输出结果是 【18】 。...
  • 下面程序的运行结果是 【17】 。typede...