-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
95 lines (79 loc) · 1.83 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.c
* Author: zephyr
*
* Created on July 11, 2016, 9:29 AM
*/
#include <stdio.h>
#include <stdlib.h>
/*
#include "graphic.h"
#include "flody.h"
#include "dijkstra.h"
#include "aov.h"
*/
#include "rank.h"
/*
*
*/
void subcall(int *a,int size)
{
int i;
for(i = 0;i<size;i++)
{
a[i] = i*i;
}
}
void see_the_test_result()
{
int a[10];
int i;
subcall(&a,10);
printf("\n");
for(i=0;i<10;i++)
printf("%5d",a[i]);
printf("\n");
a == &a ? printf("a==&a[0]") : printf("a != &a[0]");
}
void main() {
// map g;
// AdjacentListMap G;
// Pathmatric P;
// DistanceTable D;
// init_graph(&g,10);
// get_random_graph(&g,1,30);
//
// printf("the original random graph\n");
// tranverse_graph(&g);
// find_shortest_path_by_floyd(&g,&P,&D);
// printf("the shorest path matric\n");
//
// tranverse_two_matric(&P,10);
// printf("the distance matric\n");
// tranverse_two_matric(&D,10);
// show_shortest_path(&P,&D,1,8);
// printf("I am executed...[%d]\n",adaptMatricMap2ListMap(&g,&G));
// tranverseListMap(&G,g.vertex_num);
// topo_rank(&G,g.vertex_num);
ArrayList list,*l;
l = &list;
generate_random_list(l,60);
printf("the origin list:\n");
tranverse_arraylist(l,0);
//SelectSort(l);
//StraightInsertSort(l);
//PartSortByStaightInsert(l,1,2);
//ShellSort(l);
//MergingSort(l);
QuickSort(l);
//HeapSort(l);
printf("the sort result is %d (0 is wrong,1 is right)\n",TestSortResult(l));
printf("the sorted list:\n");
tranverse_arraylist(l,0);
//see_the_test_result();
}