#include #include #include "rkdtree.h" rkdtree_t *rkdtree_init(unsigned int dim) { rkdtree_t *t = malloc(sizeof(rkdtree_t)); t->root = NULL; t->dim = dim; /* Init seed */ srandom(time(NULL)); return t; } static void rkdtree_dump_node(rkdnode_t *N) { printf("(%d,%d)\n", N->key[0], N->key[1]); if ( N->L != NULL ) rkdtree_dump_node(N->L); if ( N->R != NULL ) rkdtree_dump_node(N->R); } void rkdtree_dump(rkdtree_t *T) { rkdtree_dump_node(T->root); }