Below is a binary tree with elements:
The tree, 'Tree' and its node 'Node' are represented as:
struct Node {
std::string key;
Node* left;
Node* right;
Node(std::string& k)
:key(k),left(NULL),right(NULL) {}
};
struct Tree {
Tree():root(NULL){}
void traversal(Node* n);
// .... more methods......
Node* root;
};
What is the correct algorithm to travel the tree in the following sequence of the nodes?
A A B E F G