CSCI 520 Lab Assignment - Week 6
Continue the Lab 5 (Hash Map). The instructor and GA will help you. The
following is Lab 5.
--------
Today’s goal is to implement a Hash Map in C/C++. Write the functions “add(…)”,
“getvalues(…)”, and “deallocate(…)”, which add a new data to the hash map,
return a value of a key, and de-allocate all memory space of the hash map,
respectively. You can decide the parameter lists of the functions. We are
supposed to handle student data, which has CWID (8 digits), name, contact
number, and major. An example code of the student structure is:
struct Node
{
unsigned int CWID; // you can use a string type for CWID too.
string Name;
string ContactNumber;
string Major;
struct Node *pNext;
};
For getvalues(…) function, you can subdivide the function into smaller, e.g.,
getName(key), getContactNumber(key), and getMajor(key), since there are
multiple values of the key. Or, getvalues(…) may return a student structure. It’s
up to you.
You may want to use a class (encouraged but not required). You can use any
constant parameters for Hash table size, and algorithm for Hash function. The
main function should look like following:
int main(void)
{
// declaration of hash map or declare some variables for hash map
…
// Add student data records that you want. (at least 5 data)
// for example,
// add(50000001, “Tom”, “900-000-0000”, “Computer Science”);
// add(50000002, “Alex”, “900-000-1234”, “Software”);
…
// Display all data
// For example, cout << getName(50000001) << getContactNumber(50000001)…
…
// deallocate all memory space
deallocate(…);
return 0;
}
Enjoy programming!!! Don’t forget submitting your source code to eCollege.
Hello,
Well not much to propose here seeing this is a lab assignment, but what I can say is that this is my area of expertise. I graduated top of my class with my BS back home, currently enrolled in my MS at McGill University in Canada (in the Top 20 worldwide according to QS University Rankings) with a 3.93 GPA, taught programming labs as well as full-fledged courses, and I currently tutor computer science courses. So it's safe to say that I have deep understanding and what it takes to complete this lab assignment; I do hand out assignments of my own authoring. The proposed assignment would be finalized in two days, it will contain clean and well structured code, as well as comments to explain everything going on. Looking forward to you accepting the proposal and me handing your complete assignment back should you find me as the your best option to take on this task. Feel free to demand any proof/validation of my claims regarding my academic career and work.
Best,
Joseph.