Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#ifndef _BINTREE_H
#define _BINTREE_H
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "helper.h"
class BinTree {
struct binTreeNode {
std::string text;
int count;
binTreeNode *left;
binTreeNode *right;
};
binTreeNode *root;
BinTree::binTreeNode *insert(binTreeNode *tree, const std::string &text);
bool contains(binTreeNode *tree, const std::string &text);
int getCount(binTreeNode *tree, const std::string &text);
void inOrder(binTreeNode *tree);
void preOrder(binTreeNode *tree);
void postOrder(binTreeNode *tree);
public:
BinTree();
void insert(const std::string &text);
bool contains(const std::string &text);
int getCount(const std::string &text);
void inOrder();
void preOrder();
void postOrder();
};
#endif //_BINTREE_H