6 5 鏈式表操作集 20分

2021-10-10 10:16:16 字數 1254 閱讀 6082

注意操作失敗時輸出資訊的輸出格式

position find

( list l, elementtype x )

l = l-

>next;

}return error;

}list insert

( list l, elementtype x, position p )

list p = l;

//通過p操作l鍊錶

while

(p) p = p-

>next;

}//沒插入成功

printf

("wrong position for insertion\n");

return error;

}list delete

( list l, position p )

list p = l;

while

(p) p = p-

>next;

}//沒刪除成功

printf

("wrong position for deletion\n");

return error;

}

position find

( list l, elementtype x )

l = l-

>next;

}return error;

}list insert

( list l, elementtype x, position p )

while

(p) p = p-

>next;

}printf

("wrong position for insertion\n");

//一定注意換行,唯獨你沒懂。。。

return error;

}list delete

( list l, position p )

list p = l;

while

(p) p = p-

>next;

}printf

("wrong position for deletion\n");

return error;

}

6 5 鏈式表操作集 20分

本題要求實現鏈式表的操作集。函式介面定義 position find list l,elementtype x list insert list l,elementtype x,position p list delete list l,position p 其中list結構定義如下 typedef...

6 5 鏈式表操作集 20分

函式介面定義 position find list l,elementtype x list insert list l,elementtype x,position p list delete list l,position p 其中list結構定義如下 typedef struct lnode ...

6 5 鏈式表操作集 20分

本題要求實現鏈式表的操作集。position find list l,elementtype x list insert list l,elementtype x,position p list delete list l,position p 其中list結構定義如下 typedef struct...