6 3 求鏈式表的表長 10分

2021-10-23 09:14:27 字數 872 閱讀 7773

函式介面定義:

int

length

( list l )

;

其中list結構定義如下:

typedef

struct lnode *ptrtolnode;

struct lnode

;typedef ptrtolnode list;

l是給定單鏈表,函式length要返回鏈式表的長度。

裁判測試程式樣例:

#include

#include

typedef

int elementtype;

typedef

struct lnode *ptrtolnode;

struct lnode

;typedef ptrtolnode list;

list read()

;/* 細節在此不表 */

intlength

( list l )

;int

main()

/* 你的**將被嵌在這裡 */

輸入樣例:

134

52-1

輸出樣例:

5
**實現:

int

length

( list l )

return length;

}

6 3 求鏈式表的表長 (10 分)

本題要求實現乙個函式,求鏈式表的表長。函式介面定義 int length list l 其中list結構定義如下 typedef struct lnode ptrtolnode struct lnode typedef ptrtolnode list l是給定單鏈表,函式length要返回鏈式表的長...

6 3 求鏈式表的表長 10分

本題要求實現乙個函式,求鏈式表的表長。函式介面定義 int length list l 其中list結構定義如下 typedef struct lnode ptrtolnode struct lnode typedef ptrtolnode list l是給定單鏈表,函式length要返回鏈式表的長...

6 3 求鏈式表的表長 10分

int length list l 其中list結構定義如下 typedef struct lnode ptrtolnode struct lnode typedef ptrtolnode list l是給定單鏈表,函式length要返回鏈式表的長度。裁判測試程式樣例 include include...