subject

In this assignment you will implement a program to manage an binary search tree (bst). you will
need to make several modifications to the bst class the i provided in the file "bst. cpp". name the
driver for this assignment "bst_driver. cpp". consider the following:
change the declaration of treenode in the file "bst. cpp"
class treenode //node in a bst
{
public:
string county_name;
double population_size;
treenode *lchild, *rchild; //left and right children pointers
};
make the following changes to the bst class in the file bst. cpp :
a) change the name from "bst" to "bst";
b) change default constructor from "bst" to "bst";
c) leave "empty" as is;
d) leave "insert" as is;
e) change name of "insert_aux" to "insert";
f) change name "del" to "del_name";
g) change name of "del_aux" to "del_name" with a different signature than f above;
h) leave "search_tree" as is;
i) change name of "search_tree_aux" to "search_tree";
j) leave "inorder_succ" as is;
k) leave "print_tree" as is;
l) change name of "print_tree_aux" to "print_tree".
m) leave private area (the state) as is;
n) add the prototype "sprted_info".
after you make the changes to the bst class the declaration in the "bst. cpp" it should look like the following declaration:
class bst
{
public:
bst ( ); //store the data file ("county_data. txt") into initial bst
~bst( ) ; //de-allocates dynamic memory allocate for tree
bool empty(); // checks to see if the tree is empty
void insert(const string & item, const double & population); //inserts a county record into bst based on
//county_name.
void insert(treenode * & , const string item, const double & population); //see insert description above
void del_name(string item); //deletes a county record based on county name.
void del_name(treenode * & loc_ptr, string item); //see del description above
treenode * search_tree(treenode *,string item); //returns pointer to node with county name
treenode * search_tree(string item); //see search_tree description above
treenode * inorder_succ(treenode *); //return pointer to inorder successor (based on county name.
void county_ranges(const string & min_name, const string & max_name); //prints all county names
//to the screen between min_name and max_name, inclusive.
void print_tree( ) ; //prints each county record to the screen sorted by county name.
void sorted_info( ); //prints each county record to a file called "county_info. txt" sorted by county
//name".
private:
treenode *root;
};
notes on implementation of county_ranges, sorted_info, and del_name are as follows:
a) the void member function "county_ranges" that accepts two values that represents a
name range and prints all the counties with a names in the range, inclusive. consider the
following prototype and function call:
prototype: void population_ranges(const string & min_name, const string & max_name);
function call: county_ranges("bay", "flager");
b) the void member function "sorted_info" that has no formal parameters. this function
will print the county information (name and population) to the file "county_info. txt".
consider the following prototype that goes inside the class declaration:
void sorted_info( );
c) void del_name(string item) deletes a county record based on county name. this function
is called from main. remember the tree is sorted (based) on county name
d) void del_name(treenode * & loc_ptr, string item) is an auxiliary function to delete a
county record based on county name. it is a member function that can only be called by
another member of the class.
all the data for this program is stored in the file "county_data. txt". the county name is listed first,
followed by the population size. note that some county names will have more than one word. for
example, "palm beach". make sure your program can handle this situation.
data:
lake 301019
lafayette 8942
lee 631330
jefferson 14658
leon 277971
jackson 49292
levy 40156
indian river 138894
liberty 8314
holmes 19873
madison 19115
hillsborough 1267775
manatee 327142
highlands 98630
marion 332529
hernando 173094
martin 147495
hendry 39089
miami-dade 2662874
hardee 27887
monroe 73873
hamilton 14671
nassau 74195
gulf 15844
okaloosa 183482
glades 12635
okeechobee 40140
gilchrist 17004
orange 1169107
gadsden 46151
osceola 276163
franklin 11596
palm beach 1335187
flagler 97376
pasco 466457
escambia 299114
pinellas 917398
duval 870709
polk 609492
dixie 16486
putnam 74041
desoto 34894
santa rosa 154104
columbia 67485
sarasota 38213
collier 328134
seminole 425071
clay 192970
citrus 140031
st. johns 195823
charlotte 160511
st. lucie 280379
calhoun 14750
sumter 97756
broward 1780172
suwannee 41972
brevard 543566
taylor 22691
bradford 28255
union 15388
bay 169856
volusia 494804
baker 27154
wakulla 30978
alachua 249365
walton 55793
washington 24935

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 24.06.2019 20:30
⭐️⭐️⭐️ what network is larger in size? man or wan? you ⭐️⭐️⭐️
Answers: 2
question
Computers and Technology, 24.06.2019 22:10
In command prompt, whats a command that will list only .ini files in c: \windows\system32 directory?
Answers: 1
You know the right answer?
In this assignment you will implement a program to manage an binary search tree (bst). you will
Questions
question
Mathematics, 08.12.2020 21:40
question
Mathematics, 08.12.2020 21:40
question
Mathematics, 08.12.2020 21:40
question
Mathematics, 08.12.2020 21:40
question
Mathematics, 08.12.2020 21:40
question
Social Studies, 08.12.2020 21:40
question
Mathematics, 08.12.2020 21:40
Questions on the website: 13722362