-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_link_main.c
More file actions
64 lines (54 loc) · 1.41 KB
/
list_link_main.c
File metadata and controls
64 lines (54 loc) · 1.41 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* File: list_link_main.c
* Author: jawinton
*
* Created on 2010年9月14日, 下午10:51
*/
#include <stdio.h>
#include <stdlib.h>
#include "list_link.h"
#include "list_sq.h"
/*
*
*/
/*
int main(int argc, char** argv) {
LinkList L,L1,L2;
int i = 1;
L = ListCreate_link(L,0);//如果没有返回值的话不能将L的值改变,及L指向的地址不变
L1 = ListCreate_link(L1,0);
ListPrint_link(L);
for (; i <= 10; i++)
ListInsert_link(L, i, 20-i);
ListInsert_link(L,5,30);
ListPrint_link(L);
ListPrint_link(inverse(L->next));
LinkList node = ListMax_link(L);
printf("%d\n",node->data);
ElemType a[5] = {3,29,4,2,5};
ListPrint_link(ListCreateFromArray_link(a,5));
ListInsert_link(L,10,30);
ListSort_link(L);
ListPrint_link(L);
printf("%d\n",ListNumber_link(L,30));
ListSortPrint_link(L);
for (i=0; i < 12; i++)
ListInsert_link(L1, i, i*i);
ListInsert_link(L1,11,121);
ListPrint_link(L1);
ListTidyup_link(L1);
ListPrint_link(L1);
printf("Max value:%d\n",ListMax_link_recu(L->next));
printf("List count:%d\n",ListCount_link_recu(L->next));
int n =12;//n的取值无所谓
printf("List average:%f\n",ListAverage_link_recu(L->next,&n));
L2 = ListMerge_link(L,L1,L2);
printf("L:");
ListPrint_link(L);
printf("L1:");
ListPrint_link(L1);
printf("L2:");
ListPrint_link(L2);
return (EXIT_SUCCESS);
}
*/