Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. (4 points - Completeness) Lookup with BST. You may have realized by now that BSTs are great for implementing lookup structures. As such, in
4. (4 points - Completeness) Lookup with BST. You may have realized by now that BSTs are great for implementing lookup structures. As such, in this question, we wish to implement a Set using Binary Search Trees. You should assume that the bst class is fully implemented, and you will use it to implement the Set class. Given below are the headers to a C++ Set class and the bst container with methods to support search, insert, delete and traverse. (implementation details omitted): template class Set [ private: template : class bst public: :// returns true if found, false if not bst *tree; public: :bool search (const T& value) Set) :I/ ignores if duplicate : bool insert (const T& value); tree = new bst(); :// removes value if present :void delete (const T& value); /* remove the specified value from the Set if it exists. returns: true if element was removed // values from in-rder traversal false if it was not found :vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started