Question: How to write this pseudo cose in c++ -------------------------------------------- // Helper method for size() int size_recurse(Node* root); // Helper method for completions(). // // Suggested
How to write this pseudo cose in c++
-------------------------------------------- // Helper method for size() int size_recurse(Node* root); // Helper method for completions(). // // Suggested base cases: // If root is nullptr, return. // If the last entry of the suggestions array is not "", return. // (since completions() has already found 5 suggestions). // // Suggested recursive case: // -If left subtree can contain strings that start with x, // recurse on left subtree. // -If root's string starts with x, // add root->s to first empty location in results. // -If right subtree can contain strings that start with x, // recurse on right subtree. void completions_recurse(string x, string* suggestions, Node* root);
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
