| www.delorie.com/gnu/docs/avl/libavl_110.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Our job isn't done until we can demonstrate that our code works. We'll do this with a test program built using the framework from the previous chapter (see section 5.14 Testing). All we have to do is produce functions for AVL trees that correspond to each of those in <@xref{\NODE\, , bst-test.c.>,98}. This just involves making small changes to the functions used there. They are presented below without additional comment.
<@xref{\NODE\, , License.>,1}
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include "avl.h"
#include "test.h"
<@xref{\NODE\, , BST print function; bst =>.> avl,119}
<@xref{\NODE\, , BST traverser check function; bst =>.> avl,104}
<@xref{\NODE\, , Compare two AVL trees for structure and content.>,187}
<@xref{\NODE\, , Recursively verify AVL tree structure.>,188}
<@xref{\NODE\, , AVL tree verify function.>,190}
<@xref{\NODE\, , BST test function; bst =>.> avl,100}
<@xref{\NODE\, , BST overflow test function; bst =>.> avl,122}
|
if (subheight[1] - subheight[0] != node->avl_balance) |
/* Recursively verify tree structure. */ size_t count; int height; recurse_verify_tree (tree->avl_root, &okay, &count, |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |