I am having trouble finding out if I did the header correctly
#include <iostream>
#ifndef TREE
#define TREE
// Node class
class Node
{
int key;
Node* left;
Node* right;
public:
Node()
{
key=-1;
left = NULL;
right = NULL;
};
void setKey(int aKey) { key = aKey; };
void setLeft(Node* aLeft) { left = aLeft; };
void setRight(Node* aRight) { right = aRight; };
int Key() { return key; };
Node* Left() { return left; };
Node* Right() { return right; };
};
// Tree class
class Tree {
Node* root;
public:
Tree();
~Tree();
Node* Root() { return root; };
void addNode(int key);
void inOrder(Node* n);
void preOrder(Node* n);
void postOrder(Node* n);
private:
void addNode(int key, Node* leaf);
void freeNode(Node* leaf);
};
#endif
Am I allowed to put an include statement there?