int main() { int i=1; treenode *root; root = binary_tree(); flatten(root); while(root->right != NULL) { printf("%d ", root->content); root = root->right; i++; } printf("\n%d\n", i); return 0; }
binary_tree &operator = (binary_tree &&other) { binary_tree(other).swap(std::move(*this)); return *this; }
binary_tree &operator = (const binary_tree &other) { binary_tree(other).swap(*this); return *this; }