We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The doc says that for the tree:
root | +----A | | | +---B | | | +---C | +----D | +---E | +---F
The resulting order in which nodes are visited using breadth_first_iterator is: root A D B C E F. But it's A B C
breadth_first_iterator
root A D B C E F
A B C
tree<char> t; auto r = t.insert(t.begin(), 'A'); auto it = t.append_child(r, 'B'); it = t.insert_after(it, 'C'); it = t.insert_after(r, 'D'); it = t.append_child(it, 'E'); it = t.insert_after(it, 'F'); auto bfit = t.begin_breadth_first(); cout << "breadthfirst from root: "; while(t.is_valid(bfit)) { cout << *bfit << " "; ++bfit; } cout << endl; tree<char>::sibling_iterator siit = t.begin(); cout << "siblings from root: "; while(t.is_valid(siit)) { cout << *siit << " "; ++siit; } cout << endl;
output:
breadthfirst from root: A B C // Not OK siblings from root: A D // OK
The text was updated successfully, but these errors were encountered:
It does work if the tree as a single head.
Sorry, something went wrong.
No branches or pull requests
The doc says that for the tree:
The resulting order in which nodes are visited using
breadth_first_iterator
is:root A D B C E F
.But it's
A B C
output:
The text was updated successfully, but these errors were encountered: