47,8 → 47,8 |
/* |
* Number of integer values we want to put into our tree |
*/ |
#define NUMVALS 7L |
|
|
extern void * |
mav_insert(struct mavl *t, const void *data, int *exists); |
|
70,8 → 70,17 |
void *data; |
struct mavliter it; |
|
int numvals = 3; |
const char * alg = "mav"; |
|
if (argc>1) { |
numvals = atoi(argv[1]); |
if (argc == 3){ |
alg = argv[2]; |
} |
} |
|
|
/* |
* Create a MAVL object which store object of size of int . Because |
* we do not have to free any memory, wo don't need to define free |
89,10 → 98,10 |
srand((unsigned int)time(NULL)); |
|
/* Put some random values into our MAVL tree */ |
for (i = 0; i < NUMVALS; i++) { |
for (i = 0; i < numvals; i++) { |
/*insval = rand();*/ |
insval = i+1; |
if (argc > 1) |
if (strcmp(alg,"mavl")==0) |
(void)mavl_insert(t, &insval, &exists); |
else |
(void)mav_insert(t, &insval, &exists); |