填空题

对长度为10的线性表进行冒泡排序,最坏情况下需要比较的次数为_________。

【参考答案】

45
<上一题 目录 下一题>
热门 试题

填空题
函数strcmp( )的功能是对两个字符串进行比较,当s所指字符串和t所指字符串相等时,返回值为0; 当s所指字符串大于t所指字符串时,返回值大于0;当s所指字符串小于t所指字符串时,返回值小于0(功能等同于库函数strcmp( ) ),请填空。#include <stdio.h>int strcmp ( chat * s, char * t){ while( * s && * t && * s=【 】{ s++;t++; }return【 】;)
填空题
以下程序的运行结果是【 】#include <string.h>typedef struct student{char name[10];long sno;float score; }STU;main( ){ STU a={“zhangsan”,2001,95},b={“Shangxian”,2002,90},c={“Anhua”,2003,95},d,*p=&d; d=a;if(strcmp(a.name,b.name)>0) d=b;if(strcmp(c.name,d.name)>0) d=c;printf(“%ld%s n”,d.sno,p->name); }
相关试题
  • 可以把具有相同属性的一些不同对象归类,称...
  • 常用的黑箱测试有等价分类法、【 】、因果...
  • 下面程序和运行运行结果是【 】。void sw...
  • 用的黑箱测试有等价分类法、【 】、因果图...
  • 一个类可以从直接或间接的祖先中继承所有属...