I am trying to build a ternary tree. How do I overload the [] operator so that when the main executes a[key1] = key2;, key1 and key2 will be added to the tree in the same node?
#include <iostream>
using namespace std;
class Tree;
class Node{
Node() : root(NULL);
friend class Tree;
private:
int keyInt;
double keyDouble;
Node *leftTree;
Node *centerTree;
Node *rightTree;
};