Purchase Solution

Country names parser and simple hash table in C++

Not what you're looking for?

Ask Custom Question

I am trying to create a program to help me with my business.

Here is a list of the countries around the world: http://www.arrl.org/files/file/DXCC/dxcclist_2011e.txt

Parse this list as appropriate to retrieve just the country names. Remove any country names that involve more than a single word. Use the remaining list of single word country names as your source of data. Do not use the "deleted entries" list.

Write a C++ program that includes a suitable hashing function and hash table to store this list of countries into your hash table. Demonstrate building the hash table, print out the final hash table, and demonstrate at least 10 cases of retrieving items (country names) from the hash table. Your system must deal with collisions in an appropriate manner.

Try at least two different sizes of hash tables and keep track of the number of collisions in each case and print those results.

Purchase this Solution

Solution Summary

Attachment contains two separate programs to parse the country list and to experiment with a simple hash table implementation.

Solution Preview

Please find attached 437593.zip that contains following files.

437593/parser.cpp
437593/hashtable.cpp
437593/dxcclist_2011e.txt
437593/countrylist.txt
437593/samplerun.txt

Here is how you should run the programs after compilation (I have tested these using g++).

parser < dxcclist_2011e.txt > countrylist.txt
hashtable countrylist.txt > ...

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.