首页/ 题库 / [填空题]写出算法的功能。int L(head){的答案

写出算法的功能。int L(head){ node * head; int n=0; node *p; p=head; while(p!=NULL) { p=p->next; n++; } return(n); }

填空题
2022-03-12 03:43
查看答案

正确答案
求单链表head的长度

试题解析

感兴趣题目
写出算法的功能。int L(head){ node * head; int n=0; node *p; p=head; while(p!=NULL) { p=p->next; n++; } return(n); }
EXCEPT when suffering from a head or chest injury a patient in shock should be placed in which position?().
设某带头结头的单链表的结点结构说明如下:typedef struct nodel{int data struct nodel*next;}node;试设计一个算法:void copy(node*headl,node*head2),将以head1为头指针的单链表复制到一个不带有头结点且以head2为头指针的单链表中。
设有一个不带头结点的单向链表,头指针为head,结点类型为NODE,每个结点包含一个数据域data和一个指针域next,该链表有两个结点,p指向第二个结点(尾结点),按以下要求写出相应语句。把该结点插入链表的尾部,释放指针s的指向。
设有一个不带头结点的单向链表,头指针为head,结点类型为NODE,每个结点包含一个数据域data和一个指针域next,该链表有两个结点,p指向第二个结点(尾结点),按以下要求写出相应语句。新开辟一个结点,使指针s指向该结点,结点的数据成员data赋值为1。
设有一个不带头结点的单向链表,头指针为head,结点类型为NODE,每个结点包含一个数据域data和一个指针域next,该链表有两个结点,p指向第二个结点(尾结点),按以下要求写出相应语句。删除链表的第一个结点。
数据加密算法与技术有多种。最有名的是IBM公司提出的DES(数据加密标准)加密算法,这是一直()的算法。
有以下程序段: typedef struct node(int data;struct node*next;)*NODE; NODE P; 以下叙述中正确的是( )。
有以下程序段 typedef struct node{ int data;struct node *next;}*NODE; NODE p; 以下叙述中正确的是
设有一个不带头结点的单向链表,头指针为head,结点类型为NODE,每个结点包含一个数据域data和一个指针域next,该链表有两个结点,p指向第二个结点(尾结点),按以下要求写出相应语句。已知p1指向另一个新结点,把它插入到p所指结点和尾结点之间。
在计算机科学领域中,算法分为两类:数值型算法和非数值型算法。下面的算法,属于数值算法类的是(46)。
已知head为带头结点的单循环链表的头指针,链表中的数据元素依次为(a1,a2,a3,a4,…,an),A为指向空的顺序表的指针。阅读以下程序段,并回答问题:(1)写出执行下列程序段后的顺序表A中的数据元素;(2)简要叙述该程序段的功能。if(head->next!=head){p=head->next;A->length=0;while(p->next!=head){p=p->next;A->data[A->length++]=p->data;if(p->next!=head)p=p->next;}}
相关题目
He screamed when ___ by any obstacle, real or imaginary.
指令ORS功能,可实现多个指令块的“与”运算。
He must have had an accident, or he _____ then.
4I dont know____he will join us or not
He must have had an accident,or he()then.
When the Pilot is embarked he or she ().
When the pilot is embarked he or she().
If a boy or a girl has grown up in a home with sharing tasks and decisions,he or she will probably______.
In the afternoon he often removes rust or()some paint work.
If he is a common carrier,he is absolutely responsible to the owner of the goods carried ()any loss or damage to them unless caused by an Act of God or the Queen’s enemies,or the inherent vice in the goods themselves,or the negligence of the owner of the goods,or a general average sacrifice.
Either he or I ______to the airport.
有以下程序段: typedef struct NODE { int num; struct NODE * nex; } OLD; 以下叙述中正确的是( )。
写出以下运算符代表信义:AND(),OR()。
The president (or head) of the House of Lords in Britain is ()
I cannot make head or tail of these instructions _____ the packet. Can you explain them to me?
Generally speaking, suction heads require to be () for high speed or large capacities than for low speed or small capacities.
Virginius would feel more or less guilty when he______.
Virginius would feel more or less guilty when he _____.
() provides the head or pressure to supply the domestic water where required.
写出算法的功能。int L(head){ node * head; int n=0; node *p; p=head; while(p!=NULL) { p=p->next; n++; } return(n); }
广告位招租WX:84302438

免费的网站请分享给朋友吧