Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void WordTree::Add(const string& n) {
- Add(root, n);
- }
- void WordTree::Add(WordNode*& p, const string& n) {
- if ( p == NULL) {
- p = new WordNode(n);
- } else if (n < p->word) {
- Add(p->left, n);
- } else {
- Add(p->right, n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment