#include
<
iostream
>
using
namespace
std;
struct
strnode;
typedef
struct
strnode
*pstrnode;
struct
strnode;
typedef
struct
strnode
*linkstring;
void
copystr_link(linkstring
&t, linkstring s)
/*將s所指的帶頭結點的鏈串複製為t 所指的帶頭結點的鏈串
*/else
t->
link
=null;p =
s->
link; r =
t;while
(p !=
null)
q->c =
p->c;q
->
link
=null;
r->
link
=q;
/*結點放入子鏈串中
*/r =q;
p =p->
link;
} }
linkstring createstr_link()
else
cin>>
ch;}
returns;}
void
printstr_link(linkstring s)
cout
<<
endl;
}void
main()
資料結構 鏈串
編寫乙個程式,實現鏈串的各種基本運算,並完成如下功能 1 建立串 s abcdefghefghijklmn 和串s1 xyz 2 輸出串s 3 輸出串的長度 4 在串的第9個字元位置插入串s1而產生串s2 5 輸出串s2 6 刪除串s第2個字元開始的5個字元而產生串s2 7 輸出串s2 8 將串s第...
資料結構之鏈串
include include typedef struct snode linkstrnode void strassign linkstrnode s,char cstr r next null void destroystr linkstrnode s free pre 迴圈結束時,p為nul...
資料結構之鏈串
include include typedef struct snode linkstrnode void strassign linkstrnode s,char cstr r next null void destroystr linkstrnode s free pre 迴圈結束時,p為nul...