当前位置:网站首页>6-3 find the table length of the linked table
6-3 find the table length of the linked table
2022-07-05 06:36:00 【timingzj】
This question requests to realize a function , Find the length of the linked list .
Function interface definition :
int Length( List L ); among List The structure is defined as follows :
typedef struct LNode *PtrToLNode;
struct LNode {
ElementType Data;
PtrToLNode Next;
};
typedef PtrToLNode List;L Is a given single linked list , function Length To return the length of the linked list .
Sample referee test procedure :
#include <stdio.h>
#include <stdlib.h>
typedef int ElementType;
typedef struct LNode *PtrToLNode;
struct LNode {
ElementType Data;
PtrToLNode Next;
};
typedef PtrToLNode List;
List Read(); /* Details are not shown here */
int Length( List L );
int main()
{
List L = Read();
printf("%d\n", Length(L));
return 0;
}
/* Your code will be embedded here */sample input :
1 3 4 5 2 -1sample output :
5Code :
int Length( List L )
{
int size = 0;
while(L)
{
L = L->Next;
size++;
}
return size;
}边栏推荐
- LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation
- Simple selection sort of selection sort
- TypeScript入门
- MPLS experiment
- Install opencv -- CONDA to establish a virtual environment and add the kernel of this environment in jupyter
- 博弈论 AcWing 893. 集合-Nim游戏
- MySQL (UDF authorization)
- ollvm编译出现的问题纪录
- 如何正确在CSDN问答进行提问
- Redis-02. Redis command
猜你喜欢
![[QT] QT multithreading development qthread](/img/7f/661cfb00317cd2c91fb9cc23c55a58.jpg)
[QT] QT multithreading development qthread
![[algorithm post interview] interview questions of a small factory](/img/62/6e330b1eba38f2dc67b21a10f0e2a8.jpg)
[algorithm post interview] interview questions of a small factory

3.Oracle-控制文件的管理

5. Oracle tablespace

Vant weave swipecell sets multiple buttons

Find the combination number acwing 889 01 sequence meeting conditions

Rehabilitation type force deduction brush question notes D1

Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth

论文阅读报告

Genesis builds a new generation of credit system
随机推荐
C - XOR to all (binary topic)
2022/6/29-日报
What is linting
Redis-01.初识Redis
将webApp或者H5页面打包成App
What is socket? Basic introduction to socket
Filter the numbers and pick out even numbers from several numbers
Alibaba's new member "Lingyang" officially appeared, led by Peng Xinyu, Alibaba's vice president, and assembled a number of core department technical teams
FFmpeg build下载(包含old version)
How to make water ripple effect? This wave of water ripple effect pulls full of retro feeling
Stack acwing 3302 Expression evaluation
Alibaba established the enterprise digital intelligence service company "Lingyang" to focus on enterprise digital growth
Using handler in a new thread
Time is fast, please do more meaningful things
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
5.Oracle-錶空間
[QT] QT multithreading development qthread
LSA Type Explanation - detailed explanation of lsa-2 (type II LSA network LSA) and lsa-3 (type III LSA network Summary LSA)
'mongoexport 'is not an internal or external command, nor is it a runnable program or batch file.
求组合数 AcWing 887. 求组合数 III