... struct StringTree { string data; StringTree * left, * right; StringTree(string s): data(s), left(NULL), right(NULL) { } void insert(string s); bool find(string s); void print(void); }; void oldinsert(StringTree * & t, string s) { if (t==NULL) t = new StringTree(s); else if (s <= t->data) oldinsert(t->left, s); else oldinsert(t->right, s); } void StringTree::insert(string s) { if (this==NULL) * this = StringTree(s); else if (s <= data) left->insert(s); else right->insert(s); }