Skip to content
Snippets Groups Projects
Commit 81475ba8 authored by Lubos Slovak's avatar Lubos Slovak
Browse files

AVL tree fixed.

- It was not possible to create instances of the tree for various
  node types. Though not used, it was a bug.
parent 82eff023
No related branches found
No related tags found
No related merge requests found
......@@ -154,11 +154,11 @@
} \
} \
\
struct node *TREE_MOVE_RIGHT(struct node *self, struct node *rhs) \
struct node *TREE_MOVE_RIGHT_##node##_##field(struct node *self, struct node *rhs) \
{ \
if (!self) \
return rhs; \
self->field.avl_right= TREE_MOVE_RIGHT(self->field.avl_right, rhs); \
self->field.avl_right= TREE_MOVE_RIGHT_##node##_##field(self->field.avl_right, rhs); \
return TREE_BALANCE_##node##_##field(self); \
} \
\
......@@ -169,7 +169,7 @@
\
if (compare(elm, self) == 0) \
{ \
struct node *tmp= TREE_MOVE_RIGHT(self->field.avl_left, self->field.avl_right); \
struct node *tmp= TREE_MOVE_RIGHT_##node##_##field(self->field.avl_left, self->field.avl_right); \
self->field.avl_left= 0; \
self->field.avl_right= 0; \
return tmp; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment