Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help implementing void completions_recurse(string x, string* suggestions, Node* root) on my .cpp on the header below the suedocode for it can be found on

Need help implementing void completions_recurse(string x, string* suggestions, Node* root) on my .cpp on the header below the suedocode for it can be found on how to do recursevly

Binary-tree-based Autocompleter.

-Store words in a binary search tree (using BST insert)

-Compute size of dictionary (using recursive tree traversal)

-Find smallest 5 completions (using recursive tree traveral)

image text in transcribed

image text in transcribed

image text in transcribed

From my .cpp

image text in transcribed

#include using namespace std; class Autocompleter public: // Same as hwAC1 Autocompleter); void insert (string x); I/ a.k.a. add() int size() void completions (string x, string* suggestions); private: // A helper class that implements // a basic binary search tree node. class Node public: Node(string s)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions