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