Question: Retrieve the NodeData sibling of a given object in the tree ( via pass - by - reference, second parameter which may initially be garbage

Retrieve the NodeData sibling of a given object in the tree (via pass-by-reference, second parameter which may
initially be garbage). It will be a copy of the actual object in the tree (if param 1 exists and is found).
SPECIAL INSTRUCTIONS: For this function, you do not get to know that the tree is a binary search tree.
You must solve the problem for a general binary tree where data could be stored anywhere (e.g., tree T4 above).
bool getSibling(const NodeData&, NodeData&) const;
-- Retrieve the NodeData parent of a given object in the tree (via pass-by-reference, second parameter which may
initially be garbage). It will be a copy of the actual object in the tree (if param 1 exists and is found).
SPECIAL INSTRUCTIONS: Ditto getSibling(), you do not get to know that the tree is a binary search tree.
bool getParent(const NodeData&, NodeData&) const;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!