-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.c
37 lines (26 loc) · 1.79 KB
/
test.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
#include <stdio.h>
//static unsigned char target_tbl[] = { 5, 7, 0, 2, 8, 3, 6, 1, 9, 4 };
static unsigned char target_tbl1[] = { 66, 35, 46, 86, 68, 26, 67, 30, 32, 78, 82, 53, 85, 71, 15, 42, 77, 19, 8, 4, 28, 87, 29, 83, 1, 17, 91, 89, 21, 37, 88, 0, 18, 25, 20, 98, 2, 40, 6, 59, 39, 55, 24, 11, 75, 60, 80, 65, 81, 22, 44, 16, 95, 70, 92, 63, 23, 45, 7, 9, 99, 47, 3, 97, 12, 50, 57, 74, 56, 49, 5, 41, 36, 84, 76, 61, 62, 31, 90, 48, 51, 96, 58, 14, 43, 34, 72, 52, 33, 73, 79, 27, 54, 38, 94, 10, 13, 64, 93, 69,};
static unsigned char target_tbl2[] = { 74, 18, 83, 15, 68, 37, 76, 52, 73, 65, 5, 40, 42, 23, 93, 39, 6, 89, 99, 71, 38, 43, 67, 51, 4, 97, 77, 80, 61, 90, 1, 98, 66, 53, 84, 10, 78, 85, 79, 41, 20, 12, 58, 24, 8, 11, 81, 56, 31, 50, 0, 17, 91, 32, 14, 16, 64, 36, 94, 19, 28, 29, 13, 54, 27, 7, 82, 75, 47, 88, 34, 45, 59, 22, 49, 3, 46, 60, 57, 33, 2, 63, 95, 35, 96, 30, 86, 21, 70, 55, 92, 72, 62, 44, 48, 26, 25, 69, 9, 87,};
static unsigned char target_tbl3[] = { 18, 43, 9, 61, 29, 5, 91, 35, 42, 40, 98, 0, 2, 15, 58, 90, 64, 3, 6, 76, 82, 84, 87, 73, 32, 81, 94, 51, 25, 55, 12, 60, 93, 54, 48, 92, 50, 59, 65, 23, 20, 46, 99, 83, 17, 38, 27, 45, 75, 8, 85, 39, 47, 37, 13, 95, 71, 88, 36, 63, 57, 62, 19, 31, 33, 49, 28, 79, 66, 41, 34, 96, 44, 14, 11, 56, 89, 22, 69, 1, 68, 97, 4, 24, 10, 74, 16, 77, 78, 21, 80, 26, 53, 67, 7, 86, 30, 52, 72, 70,};
void print_tbl(unsigned char* tbl, int cnt)
{
int ii;
for(ii=0; ii<cnt; ii++)
printf("%u, ", tbl[ii]);
}
void bubble_sort(unsigned char* tbl, int cnt)
{
/* */
}
int main()
{
printf("input = ");
print_tbl(target_tbl, sizeof(target_tbl));
printf("\n");
bubble_sort(target_tbl, sizeof(target_tbl));
printf("input = ");
print_tbl(target_tbl, sizeof(target_tbl));
printf("\n");
return 0;
}