home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
basedemo
/
btree
/
simple.cxx
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-14
|
970b
|
35 lines
// Simple tests of the B-tree methods
#include "base/tbtree.h"
#include "base/memory.h"
#include <iostream.h>
typedef CL_BTree<CL_String> CL_StringBTree;
void main ()
{
CL_MemoryLeakChecker checker (cout);
CL_StringBTree tree;
CL_String s;
char* t = new char [44];
s = "Hello";
cout << s << " Add returned " << (tree.Add (s) ? "TRUE" : "FALSE") << endl;
cout << s << " Add returned " << (tree.Add (s) ? "TRUE" : "FALSE") << endl;
cout << s << " Find returned '" << tree.Find (s) << "'\n";
s = "Goodbye";
cout << s << " Add returned " << (tree.Add (s) ? "TRUE" : "FALSE") << endl;
cout << s << " Find returned '" << tree.Find (s) << "'\n";
cout << s << " Remove returned " << (tree.Remove (s) ? "TRUE" : "FALSE")
<< endl;
cout << s << " Find returned '" << tree.Find (s) << "'\n";
cout << s << " Remove returned " << (tree.Remove (s) ? "TRUE" : "FALSE")
<< endl;
}