网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
填空题
设线性链表的存储结构如下: struct node {ELEMTP data; /*数据域*/ struct node *next; /*指针域*/ } 试完成下列建立单链表的算法。 creat() {char var; head=(struct node *)malloc(sizeof(struct node)); head->next= () ; while((var=getchar())!=‘/n’){ ptr=( struct node *)malloc(sizeof(struct node)); ptr->data= var ;ptr->next=head->next; head->next= ptr ; } }

参考答案

参考解析
解析: 暂无解析
更多 “填空题设线性链表的存储结构如下: struct node {ELEMTP data; /*数据域*/ struct node *next; /*指针域*/ } 试完成下列建立单链表的算法。 creat() {char var; head=(struct node *)malloc(sizeof(struct node)); head-next= () ; while((var=getchar())!=‘/n’){ ptr=( struct node *)malloc(sizeof(struct node)); ptr-data= var ;ptr-next=head-next; head-next= ptr ; } }” 相关考题
考题 有以下程序段typedef struct node { int data; struct node *next; } *NODE;NODE p;以下叙述正确的是A)p 是指向 struct node 结构变量的指针的指针B)NODE p ;语句出错C)p 是指向 struct node 结构变量的指针D)p 是 struct node 结构变量

考题 函数 main() 的功能是 : 在带头结点的单链表中查找数据域中值最小的结点 . 请填空#include stdio.hstruct node{ int data;struct node *next;};int min(struct node *first)/* 指针 first 为链表头指针 */{ strct node *p; int m;p=first-next; m=p-data;p=p-next;for(;p!=NULL;p= _[20]_______ )if(p-datam) m=p-data;return m;}

考题 设计递归算法,判断二叉树t是否满足小根堆的特点。二叉链表的类型定义如下: typedef int datatype;//结点的数据类型,假设为inttypedef struct NODE *pointer;//结点指针类型struct NODE {datatype data;pointer lchild,rchild;};typedef pointer bitree;//根指针类型

考题 有以下程序段 typedef struct node { int data; struct node *next; } *NODE; NODE p; 以下叙述正确的是( )。A.p是指向struct node结构变量的指针的指针B.NODE p;语句出错C.p是指向struct node结构变量的指针D.p是struct node结构变量

考题 以下程序把三 个 NODETYP E 型的变量链接成一个简单的链表 , 并 在 whil e 循环中输出链表结点数据域中的数据,请填空。#include stdio.hstruct node{int data; struct node *next;};typedef struct node NODETYPE;main(){ NODETYPE a,b,c,*h,*p;a.data=10;b.data=20;c.data=30;h=a;a.next=b;b.next=c;c.next='\0';p=h;while(p){printf("%d,", p-data); 【 1 5 】 ; }printf("\n");}

考题 以下程序把三个NODETYPE型的变量链接成一个简单的链表,并在while循环中输出链表结点数据域中的数据,请填空#include stdio.hstruct node{int data; struct node *next;};typedef struct node NODETYPE;main(){NODETYPE a,b,c,*h,*p;a. data=10;b.data=20;c.data=30;h=a;b. next=b;b.next=c;c.next=’\0’;p=h;while(p){printf(“d”,p-data);【15】;}}

考题 以下程序的功能是:建立一个带布头结点的单向链表,并将存储在数组中的字符依次存储到链表的各个结点中,请从与下划线处号码对应的一组选项中选择出正确的选项#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);…}(1)A.char*B.struct nodeC.struct node*D.char

考题 下面函数的功能是将指针t2所指向的线性链表,链接到t1所指向的链表的末端。假定t1所指向的链表非空struct node{ float x;struct node *next;};connect(struct node *t1, struct node *t2){ if(t1-next==NULL)t1-next=t2;else connect(______ ,t2); }要实现此功能则应该添入的选项是A.t1.nextB.++t1.nextC.t1-nextD.++t1-next

考题 以下程序中函数fun的功能是:构成一个如图所示的带头结点的单词链表,在结点的数据域中放入了具有两个字符的字符串。函数disp的功能是显示输出该单链表中所有结点中的字符串。请填空完成函数disp。[*]include<stdio.h>typedef struct node /*链表结点结构*/{char sub[3];struct node *next;}Node;Node fun(char s) /*建立链表*/{ … }void disp(Node *h){ Node *

考题 在C语言中,可以用typedef声明新的类型名来代替已有的类型名,比如有学生链表结点: typedef struct node{ int data; struct node * link; }NODE, * LinkList; 下述说法正确的是______。A.NODE是结构体struct node的别名B.* LinkList也是结构体struct node的别名C.LinkList也是结构体struct node的别名D.LinkList等价于node*

考题 函数min()的功能是:在带头结点的单链表中查找数据域中值最小的结点。请填空includestruc 函数min()的功能是:在带头结点的单链表中查找数据域中值最小的结点。请填空include <stdio.h>struct node{ int data;struct node *next;};int min(struct node *first)/*指针first为链表头指针*/{ struct node *p; int m;p=first->next; re=p->data; p=p->next;for( ;p!=NULL;p=【 】)if(p->data<m ) re=p->data;return m;}

考题 以下程序的功能是:建立一个带有头结点的甲—向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请从与下划线处号码对应的一组选项中选择出正确的选项。#include <stdlib.h>struct node{ char data; struct node *next: };(1) 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 = (2) ;q->next = p;q - (3) ;S++;}p->next='\0';return h;}main(){char str[]="link list";struct node *head;head = CreatList(str);}(1)A.char*B.struct nodeC.struct node*D.char

考题 已知形成链表的存储结构如下图所示,则下述类型描述中的空白处应填______。 struct link { char data; ______; }node;A.struct link nextB.link * nextC.struct next linkD.struct link *next

考题 以下程序把三个NODEIYPE型的变量链接成—个简单的链表,并在while循环中输出链表结点数据域中的数据。请填空。include<stdio.h>struct node{ int data;struct node*next;);typedef struct node NODETYPE;main(){ NODETYPEa,b,c,*h,*p;a.data=10;b.data=20;c.data=30;h=a;anext=b;b.next=c;c,next='\0';p=h;while(p){printf("%d,",p->data):【 】;}printf("\n");}

考题 以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转储到链表的各个结点中,请从与下划线处号码对应的一组选若中选择出正确的选项。#include stuct node{ char data; struct node *next;}; (48) CreatLis(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=CreatLis(str); ...}A.char *B.struct nodeC.struct node*D.char

考题 有以下程序 include struct NODE {int num;stmct NODE*next;}; main() { struct NODE 有以下程序#include<stdlib.h>struct NODE{ int num;stmct NODE*next;};main(){ struct NODE*p,*q,*r;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p->num=10;q->num=20;r->num=30;p->next=q;q->next=r;printf(“%d\n”,p->num+q->next->num);}程序运行后的输出结果是A.10B.20C.30D.40

考题 已知形成链表的存储结构如下图所示,则下述类型描述中的空白处应填______。 struct 1ink { char data; }node;A.struct link nextB.link*nextC.sluct next linkD.struct link*next

考题 链表题:一个链表的结点结构struct Node{int data ;Node *next ;};typedef struct Node Node ;(1)已知链表的头结点head,写一个函数把这个链表逆序( Intel)

考题 有以下程序: include struct NODE { int num; struct NODE*next; }; main() { struct 有以下程序:#include <stdlib.h>struct NODE{ int num; struct NODE *next; };main(){ struct NODE *p,*q,*r;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)mallloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p->num=10;q->num=20; r->num=30;p->next=q;q->next=r;printf("%d\n",p->num+q->next->num);}程序运行后的输出结果是( )。A.10B.20C.30D.40

考题 已知形成链表的存储结构如下图所示,则下述类型描述中的空白处应填______。 struct link { char data; ______, }node;A.struct link nextB.link *nextC.stuct next linkD.struct link *next

考题 下面正确定义了仅包含一个数据成员info的单链表的结点类型。struct node { int info;struct node next;} () 此题为判断题(对,错)。

考题 有以下程序 include struct NODE {int num;struct NODE*next;} main() {struct NODE 有以下程序#include<stdlib.h>struct NODE{int num;struct NODE*next;}main(){struct NODE *P,*q,*r;p=(struct NODE *)malloc(sizeof(struct NODE));q=(struct NODE *)malloc(sizeof(struet NODE));r=(struct NODE*)malloc(sizeof(struct NODE)):p->num=10;q->num=20;r->num=30;p->next=q;q->next=r;printf("%d\n",p->num+q->next->num):}程序运行后的输出结果是( )A.10B.20C.30D.40

考题 以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请填空。 #include <stdlib.h> stuct node { char data; struet node * next; }; stntct node * CreatList(char * s) { struet 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 = ( ) q- >next=p; q=p; a++; p- > next ='\0'; return h; } main( ) { char str[ ]= "link list"; struet node * head; head = CreatList(str);A.*sB.sC.*s++D.(*s)++

考题 下面程序的功能是建立一个有 3 个 结 点的单向循环链表,然后求各个 结 点数值域 data 中数据的和。请填空。include stdio.hinclude stdlib.hstruct NODE{ int data;struct NODE *next;};main(){ struct NODE *p,*q,*r;int sum=0;p=(struct NODE*)malloc(sizeof(struct NODE));q=(struct NODE*)malloc(sizeof(struct NODE));r=(struct NODE*)malloc(sizeof(struct NODE));p-data=100; q-data=200; r-data=200;p- next =q; q- next =r; r- next =p;sum=p-data+p-next-data+r-next-next 【 19 】 ;printf("%d\n",sum);}

考题 填空题设顺序存储的线性表存储结构定义为: struct sequnce {ELEMTP elem[MAXSIZE]; int len; /*线性表长度域*/ } 将下列简单插入算法补充完整。 void insert(struct sequnce *p,int i,ELEMTP x) {v=*p; if(iv.len+1)printf(“Overflow“); else { for(j=v.len;();j- -)(); v.elem[i]= () ;v.len=(); } }

考题 问答题设某带头结头的单链表的结点结构说明如下:typedef struct nodel{int data struct nodel*next;}node;试设计一个算法:void copy(node*headl,node*head2),将以head1为头指针的单链表复制到一个不带有头结点且以head2为头指针的单链表中。

考题 填空题设线性链表的存储结构如下: struct node {ELEMTP data; /*数据域*/ struct node *next; /*指针域*/ } 试完成下列在链表中值为x的结点前插入一个值为y的新结点。如果x值不存在,则把新结点插在表尾的算法。 void inserty(struct node *head,ELEMTP x,ELEMTP y) {s=(struct node *)malloc(sizeof(struct node)); (); if(){s-nexr=head;head=s;} else { q=head;p=q-next; while(p-dqta!=xp-next!=NULL){q=p;()} if(p-data= = x){q-next=s;s-next=p;} else{p-next=s;s-next=NULL;} } }