Question: I am coding this in C++ I have a BST filled with a class called Entry. Entry contains 2 members, a string and an int.

I am coding this in C++

I have a BST filled with a class called Entry. Entry contains 2 members, a string and an int. The BST is sorted alphabetically by the string of each Entry. How do I take the 3 Entries with the highest int and put them into a vector from GREATEST to LEAST?

// A helper class that stores a string and a frequency. class Entry { public: string s; int freq; };

// A helper class that implements a BST node. class Node { public: Node() { left = right = nullptr; }

Node(Entry e) { this->e = e; left = right = nullptr; }

Entry e; Node* left; Node* right; };

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!