c**
: 單鏈表逆置
/*author : glq2000[[email protected]
date : wen, 2010-7-21
功能 : 實現單鏈表的逆置等
*/#include
#include
#include
typedef
struct
_node
node,*
pnode;
pnode
buildlink(int n); //構造乙個節點數目為n個的鍊錶, 返回煉表頭指標
pnode
reverselink(pnode
ph); //單鏈表的逆置函式,返回新鍊錶的表頭指標
void
outputlink(pnode
ph); //輸出單鏈表
intmain()
pnode
buildlink(int n)
pn->
value=i;
pn->
next
=ph;
ph= pn;
}return
ph;}
void
outputlink(pnode
ph)printf("
\n");
}//實現單鏈表逆置的函式
pnode
reverselink(pnode
ph)return
pbefore;
}
單鏈表逆置
單鏈表逆置 include include define item num 10 typedef struct tagnode node node linklist create void linklist destroy node head void linklist print node hea...
單鏈表逆置
name 單鏈表逆置 author 巧若拙 date 22 11 14 16 13 description 分別用遞迴和非遞迴兩種方式實現單鏈表 不含頭結點 的逆置 include include include typedef char elemtype typedef int status 函式...
單鏈表逆置
最近在leetcode oj上刷題,將一些演算法題的解法記錄下來,也期待一些新的更好的方法。題目是這樣滴 206.reverse linked list reverse a singly linked list.hint a linked list can be reversed either it...