|
|
|
|
|
|
|
|
|
|
|
|
Our dictionary with 370106 words has been read in 998 ms Give me a word : albatroos albatroos does not exist in the dictionary! Operation done in 94600 ns Give me a word : albatros The word albatros has been found :) Operation done in 176900 ns |
It load more 350K words in less than 1 seconds |
|
|
|
|
1. Bird 2. Cat 3. Cow 4. Crocodile 5. Dog 6. Fish 7. Snake ---------------- Found the word "Fish" Found the word "Snake" word "Scorpion" does not exist in the dictionary! Found the word "Bird" Found the word "Crocodile" |
|
|
Our dictionary with 466,546 words has been read in 298 ms Give me a word : albatros The word "albatros" has been found :) Operation done in 2,371 ns Give me a word : albatroos "albatroos" does not exist in the dictionary! Operation done in 2,766 ns Give me a word : zebra The word "zebra" has been found :) Operation done in 3,952 ns Give me a word : zebar "zebar" does not exist in the dictionary! Operation done in 3,556 ns Give me a word : exit |
|
|
vector: 1.141108 seconds set: 1.425130 seconds |
|
|
Our dictionary with 370106 words has been read in 2166 ms Give me a word : albatroos albatroos does not exist in the dictionary! Operation done in 213500 ns Give me a word : albatros The word albatros has been found :) Operation done in 200200 ns |
Our dictionary with 370106 words has been read in 116 ms Give me a word : albatroos albatroos does not exist in the dictionary! Operation done in 146000 ns Give me a word : albatros The word albatros has been found :) Operation done in 137500 ns |
Which CPU you have inside? |
|
|
vector insert and sort: 1.014847 seconds set insert: 1.175835 seconds vector search: 1.085210 seconds set search: 1.408074 seconds |
For a large stable dictionary, searching in a sorted vector may be (typically would be) somewhat more efficient. |
|
|
Our dictionary with 466,546 words has been read in 466 ms Give me a word : albators "albators" does not exist in the dictionary! Set operation done in 2,371 ns Vector operation done in 1,580 ns Give me a word : zebra The word "zebra" has been found :) Set operation done in 4,346 ns Vector operation done in 1,976 ns Give me a word : albatroos "albatroos" does not exist in the dictionary! Set operation done in 4,346 ns Vector operation done in 1,976 ns Give me a word : qwerty The word "qwerty" has been found :) Set operation done in 3,556 ns Vector operation done in 1,580 ns Give me a word : exit |
I've been trying to make the binary search work but it just doesn't, I know its something with the word compares but this is probably version 10 of my function and it still sucks |
|
|
Our dictionary with 466,546 words has been read in 404 ms Give me a word : albatros The word "albatros" has been found :) Set operation done in 395 ns Vector operation done in 1,976 ns Give me a word : zebra The word "zebra" has been found :) Set operation done in 1,581 ns Vector operation done in 1,580 ns Give me a word : qwerty The word "qwerty" has been found :) Set operation done in 790 ns Vector operation done in 1,975 ns Give me a word : albatroos "albatroos" does not exist in the dictionary! Set operation done in 790 ns Vector operation done in 2,371 ns Give me a word : albators "albators" does not exist in the dictionary! Set operation done in 396 ns Vector operation done in 1,975 ns Give me a word : exit |