Question: Using C++ Given an arbitrary ransom note, consisting of 15 20 words and several magazines, write a function that will return a true, if the

Using C++

Given an arbitrary ransom note, consisting of 15 20 words and several magazines, write a function that will return a true, if the ransom note can be constructed from the words in the magazines, otherwise it will return a false. Each word in the magazines can only be used once in your ransom note. The algorithm should work efficiently, such as, utilizing hash tables for storing and looking up strings. An example hash function maybe the sum of the ascii values of all the characters in the string, modulus an appropriate positive integer. Utilize the built in string class, and some of its methods. For testing the code, utilize the ransom note and the magazines provided in files RansomNote.dat, Magazine1.dat, Magazine2.dat, Magazine3.dat, Magazine4.dat, Magazine5.datand Magazine6.dat.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!