Блог пользователя rezzaque

Автор rezzaque, история, 10 лет назад, По-английски

Hello everyone! I encountered a problem at work. I have to search from 1000000 strings that are built from only 0's and 1's if any of them is at least %80 percent similar to an arbitrarily given string. By similarity I mean hamming distance. The thing is linear searching is no good enough to make it in at least 0.2 seconds. All strings are of the same length which is 64 characters. Any help or suggestion is welcome, have a nice day!

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
10 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

store strings as 64-bit numbers, Hamming distance between strings a and b will be popcount(a xor b). I believe this should fit in 0.2s.