| www.delorie.com/gnu/docs/avl/libavl_151.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There's little new in the testing code. We do add an test for tbst_balance(), because none of the existing tests exercise it. This test doesn't check that tbst_balance() actually balances the tree, it just verifies that afterwards the tree contains the items it should, so to be certain that balancing is correct, turn up the verbosity and look at the trees printed.
Function print_tree_structure() prints thread node numbers preceded
by `>', with null threads indicated by `>>'. This notation
is compatible with the plain text output format of the texitree
program used to draw the binary trees in this book. (It will cause
errors for PostScript output because it omits node names.)
<@xref{\NODE\, , License.>,1}
#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include "tbst.h"
#include "test.h"
<@xref{\NODE\, , TBST print function.>,291}
<@xref{\NODE\, , BST traverser check function; bst =>.> tbst,104}
<@xref{\NODE\, , Compare two TBSTs for structure and content.>,292}
<@xref{\NODE\, , Recursively verify TBST structure.>,293}
<@xref{\NODE\, , TBST verify function.>,294}
<@xref{\NODE\, , TBST test function.>,295}
<@xref{\NODE\, , BST overflow test function; bst =>.> tbst,122}
|
/* Test tbst_balance(). */ if (verbosity >= 2) |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |