6
Trovare il massimo XOR di due numeri in un intervallo: possiamo fare meglio del quadratico?
Supponiamo stiamo dato due numeri lll e e che vogliamo trovare per l \ le i, \, j \ le r .rrrmax(i⊕j)max(i⊕j)\max{(i\oplus j)}l≤i,j≤rl≤i,j≤rl\le i,\,j\le r L'algoritmo ingenuo controlla semplicemente tutte le coppie possibili; ad esempio in ruby avremmo: def max_xor(l, r) max = 0 (l..r).each do |i| (i..r).each do |j| …
14
algorithms
algorithms
machine-learning
statistics
testing
terminology
asymptotics
landau-notation
reference-request
optimization
scheduling
complexity-theory
time-complexity
lower-bounds
communication-complexity
computational-geometry
computer-architecture
cpu-cache
cpu-pipelines
operating-systems
multi-tasking
algorithms
algorithm-analysis
education
correctness-proof
didactics
algorithms
data-structures
time-complexity
computational-geometry
algorithms
combinatorics
efficiency
partitions
complexity-theory
satisfiability
artificial-intelligence
operating-systems
performance
terminology
computer-architecture