hotrace is a very quick search engine based on association key-value.
-
hotrace reads the standard input
-
each line contains a key, the next line its value
-
then each line contains a key
• The goal is to find the value of each of these keys as fast as possible (if there is no match we output "key: Not found."
We run a hash algorithm on the key word and get a number
, then we stock the couple key-value in a binary tree, and stock a pointer to this tree in an array of pointers at the rank number
git clone https://github.com/p-milan/hotrace
make && ./hotmouli hotrace resources/test01.htr
Possible outcome :
Running tests...done.
Hotrace : starting control procedure
Control ok.
Speed reference number is 1.39
Less is best.
make && ./hotrace < resources/test02.htr
Possible outcome :
trois: Not found.
make exec
Possible outcome :
1
2
5
7
9
10