Question: Implement a Set using a binary search tree and following the interface shown below. template struct Node { T value; Node * left;

Implement a Set using a binary search tree and following the interface shown below.\ \ template \ struct Node {\ T value;\ Node * left;\ Node * right;\ };\ \ template \ struct Set {\ Node * root;\ };\ \ template void initialize(Set>T< &set);\ template void destroy(Set>T< &set)\ template void insert(Set>T< &set,T item);\ template void remove(Set>T< &set,T item);\ template bool contains(Set>T< &set,T item);\ template int size(Set>T< &set);\ The pointer root should reference a binary search tree of Nodes holding the members currently in the Set.\ \ initialize() sets up the data structure\ destroy() cleans up the before Set goes out of scope\ insert() includes item as member of the Set\ remove() excludes item from being a member of the Set\ contains() reports whether item is currently a member of the Set\ size() reports the current size (cardinality) of the Set

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem youll need to implement a Set data structure using a binary search tree BST The functions and their purposes are already defined ... View full answer

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!