I'm implementing an algorithm that involves a variation of BFS using Visual C++. The queue contains objects of type Node* which I am trying to access the members (left and right subtrees) of. For some reason, simply running the following code retus an error:
queue<Node*> aQueue;
aQueue.push(root);
cout << aQueue.front->left;// Error: left of '->data' must point tclass/struct/union/generic type
If I'm trying to implement BFS with a queue in C++ and I need to access the members of the Node pointer at the front of the queue, what is the proper way to do it?