-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathordering.c
49 lines (34 loc) · 945 Bytes
/
ordering.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
// ordering.c 整列手続きの繰り返し
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "main_canost.h"
//#define TEST_ORDERING 1
extern int equive,pre_equive;
int ordering( void ){
#ifdef TEST_ORDERING
int i;
i=0;
printf("ordering \n");
#endif
// 規範化のための整列手続き
equive = 2; // a1st[ ZERO ] のために 2 から
do{
pre_equive = equive;
equive = 2; // a1st[ ZERO ] のために 2 から
#ifdef TEST_ORDERING
printf("iteration %d \n",++i);
#endif
/* ------- Bottom-Up Sorting -------- */
if( sort_b_u() != EXIT_SUCCESS ){
printf("error: Cannot execute bottom-up sorting \n" );
exit( EXIT_FAILURE );
}
/* ------- Top-Down Sorting ------- */
if( sort_t_d() != EXIT_SUCCESS ){
printf("error: Cannot execute top-down sorting \n" );
exit( EXIT_FAILURE );
}
}while( equive != pre_equive );
return EXIT_SUCCESS;
}