0

The program, which you will write, will be a console application of C++ and will read the file.txt file while separating the hidden countries and cities when it starts to work.
Sample file (This is only a sample file, your program must read much longer files)
Uruguay# Montevideo
The USA # New york
Netherlands#Copenhagen
The USA#Texas
Turkey #Van
Hungary#Pest
Germany#Hannover
……………..
……………..

The countries which are read will be stored in the binary search tree which is called ’ countries’. The cities will be added to the Heap Tree according to the countries they are bounded. Binary search tree cannot be a pattern(template). You must write your own binary search tree which is suitable for the application. You can form Heap tree by using series.
After the names of the countries and cities are read and stored in binary search tree and Heap tree, inorder under the binary search tree must be read and the namas of the countries must be written on the monitor. The same procedure must be done for the names of the cities by using heap sort which is a part of heap tree. When you have finshed the procedure above,you will see the output below on your monitor.

Display output
Germany
Hannover
Hungary
Pest
Netherlands
Copenhagen
Uruguay
Montevideo
USA
New york Texas
Turkey
Van

All of the objects which will be formed must be at HEAP memory region
and there must be certainly no waste while the program is operating and when it is shut down. The sub field of each category must be private and the access to this subfields must be through methods when it is necessary .
Goto can’t be used in the program. The usage of any patterns in the program can’t be accepted.
All categories must have two different files,one for the title and another for the source. There can’t be method body in the title files.
Prospective consept of class (minimum)
Country Class
City Class
Node Class (binary search tree can be in this part)
Binary search tree Class
Heap Tree Class
Test Program (This will be a working program not a class)

2
Contributors
1
Reply
13
Views
2 Years
Discussion Span
Last Post by Maritimo
0

We don´t do the homework of anybody. Work on your problem and make some questions. We will only give you some hints.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.