心如止水
Je n'ai pas le temps
首頁
新隨筆
新文章
聯系
聚合
管理
posts - 400,comments - 130,trackbacks - 0
<
2010年11月
>
日
一
二
三
四
五
六
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
留言簿
(15)
給我留言
查看公開留言
查看私人留言
隨筆分類
(415)
Programming Diary(19)
算法與數據結構(22)
題目分類:遞推/遞歸(14)
題目分類:動態規劃(58)
題目分類:基礎/模擬(67)
題目分類:排序(14)
題目分類:數據結構(52)
題目分類:數學/數論(46)
題目分類:搜索(47)
題目分類:圖論(50)
題目分類:字符串處理(25)
足跡(1)
隨筆檔案
(400)
2011年11月 (3)
2011年9月 (11)
2011年8月 (41)
2011年7月 (23)
2011年6月 (4)
2011年5月 (36)
2011年4月 (36)
2011年3月 (8)
2011年2月 (8)
2011年1月 (4)
2010年11月 (7)
2010年10月 (22)
2010年9月 (15)
2010年7月 (3)
2010年6月 (2)
2010年4月 (5)
2010年3月 (19)
2010年2月 (33)
2010年1月 (120)
搜索
最新隨筆
1.?UVa 10229 Modular Fibonacci
2.?UVa 10128 Queue
3.?UVa 10269 Adventure of Super Mario
4.?UVa 128 Software CRC
5.?UVa 10820 Send a Table
6.?Ural 1049 Brave Balloonists
7.?UVa 465 Overflow
8.?UVa 10310 Dog and Gopher
9.?UVa 10278 Fire Station
10.?UVa 10168 Summation of Four Primes
最新評論
1.?re: vijos P1051 送給圣誕夜的極光
評論內容較長,點擊標題查看
--王康
2.?re: 感慨、感傷,我的OI生涯
@涼子 120501168
--lee1r
3.?re: 感慨、感傷,我的OI生涯
評論內容較長,點擊標題查看
--lee1r
4.?re: 感慨、感傷,我的OI生涯
評論內容較長,點擊標題查看
--涼子
5.?re: 經典迭代加深搜索——埃及分數
評論內容較長,點擊標題查看
--lyd
評論排行榜
1.?感慨、感傷,我的OI生涯(14)
2.?UVa 10154 Weights and Measures(13)
3.?UVa 10010 Where's Waldorf?(12)
4.?UVa 10003 Cutting Sticks(8)
5.?UVa 401 Palindromes(6)
鏈表常用操作
#include
<
stdio.h
>
#include
<
stdlib.h
>
struct
node
{
int
data;
struct
node
*
next;
}
;
//
結構類型的說明
struct
node
*
stack(
struct
node
*
head)
{
int
i;
struct
node
*
p;
p
=
(
struct
node
*
)malloc(
sizeof
(
struct
node));
p
->
next
=
NULL;
for
(i
=
0
;i
<
10
;i
++
)
{
head
=
(
struct
node
*
)malloc(
sizeof
(
struct
node));
p
->
data
=
i;
head
->
next
=
p;
p
=
head;;
}
return
(head);
}
//
棧
struct
node
*
team(
struct
node
*
head)
{
int
i;
struct
node
*
tail,
*
p;
head
=
(
struct
node
*
)malloc(
sizeof
(
struct
node));
tail
=
head;
for
(i
=
0
;i
<
10
;i
++
)
{
p
=
(
struct
node
*
)malloc(
sizeof
(
struct
node));
p
->
data
=
i;
tail
->
next
=
p;
tail
=
p;
}
tail
->
next
=
NULL;
return
(head);
}
//
隊列
void
print_list(
struct
node
*
head)
{
struct
node
*
p;
p
=
head
->
next;
printf(
"
Begin
"
);
while
(p
!=
NULL)
{
printf(
"
->%d
"
,p
->
data);
p
=
p
->
next;
}
printf(
"
->End\n
"
);
}
//
鏈表輸出
void
detele_x(
struct
node
*
head,
int
x)
{
struct
node
*
p,
*
q;
p
=
head;
q
=
head
->
next;
while
(q
->
data
!=
x
&&
q
->
next
!=
NULL)
{ p
=
q; q
=
q
->
next; }
if
(q
->
data
==
x)
p
->
next
=
q
->
next;
free(q);
}
//
刪除數據域為x的結點
void
add_x_y(
struct
node
*
head,
int
x,
int
y)
{
struct
node
*
add_new,
*
p,
*
q;
add_new
=
(
struct
node
*
)malloc(
sizeof
(
struct
node));
add_new
->
data
=
x;
p
=
head;
q
=
head
->
next;
while
(q
!=
NULL
&&
q
->
data
!=
y)
{ p
=
q; q
=
q
->
next; }
p
->
next
=
add_new;
add_new
->
next
=
q;
}
//
在數據為y的結點前插入數據域為x的結點
posted on 2010-01-06 18:22
lee1r
閱讀(227)
評論(0)
編輯
收藏
引用
所屬分類:
算法與數據結構
只有注冊用戶
登錄
后才能發表評論。
【推薦】100%開源!大型工業跨平臺軟件C++源碼提供,建模,組態!
相關文章:
網絡流24題
快速冪取模
最小費用最大流算法
數組模擬鏈表操作
Splay樹的基本操作
Miller-Rabbin素數測試
第一個線段樹程序
各頂點間的最短路——Floyed算法
最小生成樹——Kruskal算法
隊列的常用操作函數
網站導航:
博客園
IT新聞
BlogJava
博問
Chat2DB
管理
Copyright ©2025 lee1r Powered By
博客園
模板提供:
滬江博客
精品久久久久久亚洲
|
亚洲精品97久久中文字幕无码
|
99久久99久久精品国产片果冻
|
狠狠色综合网站久久久久久久高清
|
欧美午夜精品久久久久免费视
|
精品久久久久久中文字幕
|
亚洲欧美另类日本久久国产真实乱对白
|
国产偷久久久精品专区
|
久久本道伊人久久
|
久久久久久午夜精品
|
色综合久久精品中文字幕首页
|
久久天天躁夜夜躁狠狠躁2022
|
91久久精品国产91性色也
|
亚洲国产精品成人久久
|
久久久久久国产精品美女
|
97超级碰碰碰碰久久久久
|
狠狠色丁香久久婷婷综合图片
|
精品一区二区久久
|
麻豆AV一区二区三区久久
|
人妻中文久久久久
|
久久精品国产精品亚洲人人
|
久久久人妻精品无码一区
|
日本久久久久久中文字幕
|
久久精品国产亚洲精品2020
|
狠狠色婷婷久久一区二区
|
亚洲精品成人网久久久久久
|
精品无码久久久久久久久久
|
区亚洲欧美一级久久精品亚洲精品成人网久久久久
|
狠狠色丁香久久婷婷综合五月
|
久久精品aⅴ无码中文字字幕不卡
|
久久精品国产亚洲一区二区三区
|
国产三级久久久精品麻豆三级
|
狠狠色丁香久久婷婷综合
|
久久99国产精品久久99小说
|
亚洲国产另类久久久精品小说
|
久久精品国产91久久综合麻豆自制
|
99久久婷婷国产综合精品草原
|
久久福利青草精品资源站
|
2021少妇久久久久久久久久
|
久久精品欧美日韩精品
|
狠狠色丁香婷婷久久综合不卡
|