What is wrong with the following function?void* _retrieve (AVL_TREE* tree, void* keyPtr, NODE* root){ if (tree->compare(keyPtr, root->dataPtr) < 0) return _retrieve(tree, keyPtr, root->left); else if (tree->compare(keyPtr, root->dataPtr) > 0) return _retrieve(tree, keyPtr, root->right); else return root->dataPtr; } // if root}
A. It is missing one recursive call to _retrieve.
B. The first if should be "if (tree->compare(keyPtr, root->dataPtr) < 0)".
C. The second if should be "if (tree->compare(keyPtr, root->dataPtr) >= 0)".
D. It does not check if the data is not in the tree.
Answer: D
You might also like to view...
Which method sets the text that's displayed when the user hovers over a JLabel?
a. setHover b. setHoverText c. setToolTip d. setToolTipText
Modify Program 22 to be more general by passing in the start and stop x and y and the mirror point in x.
What will be an ideal response?
The Set Up Slide Show button which contains the option Browsed at a Kiosk is located on the ________ tab
A) Slide Show B) Design C) Format D) Transitions
int x = 27;int y = 10;do x = x / 3;while (x >= y);How many times does the statement above execute?
A. none B. once C. twice D. three times