I have a closed hash table with open addressing and linear probing for the following dictionary of words in a text;
The input operation works like this:
1) The program asks for the first line of the text (with a limit of 100 characters) at this point I'm breaking the text, and adding the words in the hash table; then ask for the 2nd line ... will continue asking the lines until you find a line called $ STOP
2) After $STOP
, the program asks for words (strings) to be searched in the hash, the result of the search will be the number of the incidence line (s) word in text;
//EXEMPLO:
$START
o mundo era bonito demais
o mundo jah foi muito belo
$STOP
mundo
bonito
//retornará:
mundo: 1 2
bonito: 1
Considering that the number of keys can vary from 1 to n (10000 for example) distinct words, how should I manage the size of my table? Should I put a table vector [10001]?
Will not you spend a lot of memory?
How to deal with this hash table problem closed with open addressing and linear polling "?