I have following problem with a binary tree:
....
template
class BinaryTree
{
private:
template
struct Node
{
T value;
Node* left;
Node* right;
};
private:
Node* root;
std::stack<Node<T>const *> stack;
stack.push(root);
while(false == stack.empty())
{
Node<T>* node = stack.pop();
this->visited(node->value);
and after that when I tried to implement breath first search: template class BinaryTree { private: template struct Node { T value; Node* left; Node* right; }; private: Node* root;
std::stack<Node<T>const *> stack;
stack.push(root);
while(false == stack.empty())
{
Node<T>* node = stack.pop();
this->visited(node->value);
I have received an error:
Error 4 error C2440: 'initializing' : cannot convert from 'void' to 'BinaryTree::Node *' c:\users\stephan\documents\visual studio 2012\projects\graphs\binarytree\binarytree.cpp 152 1 BinaryTree