-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
47 lines (37 loc) · 897 Bytes
/
main.c
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
#include <stdio.h>
#include"list.c"
#include"fileread.c"
#include"filewrite.c"
#include"BubbleSort.c"
#include"QuickSort.c"
void test_list()
{
SDataType data = {"Ryan", 0};
PNode head = ListInit(data);
SDataType data2 = {"Jack", 2};
head = ListAddEnd(head, data2);
SDataType data3 = {"Ryan", 0};
head = ListMergeNode(head, data3);
ListAllNode(head);
ListDestory(head);
return;
}
int main()
{
PNode head = NULL;
//test_list();
//读取文件创建单链表
head = read_file("user_login.txt", head);
//ListAllNode(head);
//将统计结果写入文件
write_file("result.txt", head);
//采用冒泡排序法排序
//BubbleSort(head);
//采用快速排序法排序
QuickSort(head);
//将排序结果写入文件
write_file("sort.txt", head);
//销毁单链表
ListDestory(head);
return 0;
}