CPP binary tree lab
Implement a function that will build a binary search tree.
2. Using the function above create a binary search tree.
3. Implement a swapSubtrees() function that will take a pointer
to a root node and a target value.
Function will search for the
target value in the tree and swap all left nodes with right nodes
for all descendant nodes.
4. Pass the tree created in step 2 to test swapSubtrees()
function.
5. You can use the inorder, postorder or preorder traversal
implemented in class to display and confirm the logic. (trace it by
hand as well)
CPP binary tree lab Implement a function that will build a binary search tree. 2. Using the function above create a bina
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
CPP binary tree lab Implement a function that will build a binary search tree. 2. Using the function above create a bina
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!