CPP binary tree lab Implement a function that will build a binary search tree. 2. Using the function above create a bina

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post by answerhappygod »

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)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply