I am implementing a Red black Tree where the insert function should have two templates, one for the item and the other for the key. I am passing the parameters in the insert function this way:
template <class Item, class Key>
void RedBlackTreeNode<Item, Key>::InsertKey(const Item *&T, const Key *&z)
I tried to pass an array(made up of random elements) in the second parameter, this way:
const int* pointer = &arr[i];
t1.InsertKey(//something else here// , pointer); //insert the tree and the node
However, I can't figure out what to pass as the first parameter in order to insert elements in the red black tree. What is the first parameter representing? I tried to pass the root of the tree, this way:
Node<int, int> n1;
t1.InsertKey(n1->root, pointer);
Unfortunately, this is not working.Any help please?
Thanks in advance.