/*
* BinaryTree.h
* Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// SOL++2000
#pragma once
#include <sol\Object.h>
#include <sol\BinaryNode.h>
namespace SOL {
class BinaryTree :public Object {
private:
BinaryNode* root;
public:
BinaryTree(BinaryNode* root1 = NULL) { root = root1; }
~BinaryTree() { delete root; }
BinaryNode* search(const TCHAR* name) {
if(root) {
return root->search(name);
} else {
return NULL;
}
}
BinaryNode* getRoot() { return root; }
void print() { if (root) root -> print(); }
void setRoot(BinaryNode* node) { root = node; }
};
}
|