Question: how to write this in c++, the pseudo code is availble already ------------------------------------------------------------ // Helper method for completions(). // // Suggested base cases: // If

how to write this in c++, the pseudo code is availble already

------------------------------------------------------------

// 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 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!