Loading...
Searching...
No Matches
Implementation for the Reversing a Binary Tree recursively algorithm. More...
#include <cassert>
#include <iostream>
#include <queue>
#include <vector>
Go to the source code of this file.
void tests::test1 () A Test to check an simple case.Implementation for the Reversing a Binary Tree recursively algorithm.
A binary tree can be reversed by swapping the left and right child of a node at each node, starting from the root, and cascading below. This solution aims to provide an implementation of a recursive reversal of a binary tree.
Definition in file reverse_binary_tree.cpp.
◆ main()main function
Definition at line 270 of file reverse_binary_tree.cpp.
270 {
272 return 0;
273}
static void test()
Function to test the correctness of the Tree Reversal.
◆ test()Function to test the correctness of the Tree Reversal.
< Single element test
< No element test
< Correct reversal test
Definition at line 260 of file reverse_binary_tree.cpp.
260 {
264}
void test1()
A Test to check an simple case.
void test3()
A Test to check an invalid shift value.
void test2()
A Test to check an empty vector.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4