Assume that the following functions are added to the Set cla…
Assume that the following functions are added to the Set class from lecture: void mystery1() { mystery1(root); } void mystery1(TreeNode*& node) { if (node != nullptr) { if (node->left == nullptr && node->right == nullptr) { delete node; node = nullptr; } else { mystery1(node->left); mystery1(node->right); } } } __________| 45 |__________ / \ | 23 | | 67 | / \ / \ | 12 | | 24 | | 50 | | 72 | / \ \ / \ | 8 | | 19 | | 30 | | 70 | | 77 | / \ | 7 | | 10 | Write the output of a preorder print of the Set if it contains the data shown above and then has the above function called on it. Write the traversal on one line with each number separated by a single space. preorder traversal: [output]
Read Details