Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hairtuq
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
hairtuq
9y ago
I'd expect a SMT (Satisfiability modulo theory) solver like z3 to work better for this use case, might be worth giving it a try. E.g. x = z3.BitVec('x', 32) y = z3.BitVec('y', 32) i1 = x | y i2 = ~(~x | ~y
32.
▲
by
hairtuq
10y ago
Yes, you can. There's an algorithm running in O((r+l) log l) time, where l is the number of lines and r is the total number of ordered pairs of line numbers at which the two files match [1]. So if all lines are unique, this runs in O(l