Using a hash table with keyword searches.?
-
A little background: The project is to store a file of "mp3s" in the form Title|Artist into a hash table. Some of the functions i need to write are search by title, search by artist, search by keyword and insert into a playlist. I am just confused as to how to initialize a hash table that would allow me to do this... here are the direct directions involving the hash table... "The data structure used to store the master music index is up to you, however, you are required to use a hash table to implement keyword searches, enabling an O(1) average case lookup. When reading the master list of music, you can hash the words in the title and artist as you read each song or you can read everything first and then hash after the end of the input file is reached. When your program starts, it must build the hash table and any other data structures that you use in O(N log N) time or better, where N is the number of songs in the input file." any help to better understand how to implement a hash table into a keyword search like this would be very helpful, thanks
-
Answer:
take each title and hash the words of the title so Johny Be Good, Hash Johny = 27, Hash Good = 87 build and index/hash table Song 1, Hash 27 Song 1, Hash 87 then you can keyword search on Johny or Good
Yahoo! Answers Visit the source
Related Q & A:
- How to add a new table to a data source?Best solution by technet.microsoft.com
- What is Hash Table, how to create a hash table?Best solution by Stack Overflow
- How to do reverse lookup in a Hash?Best solution by reverse-hash-lookup.online-domain-tools.com
- What's a hash check?Best solution by Yahoo! Answers
- Is there a website that does word searches for you?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.