|
|
|
|
|
by Retric
4197 days ago
|
|
With parrell analysis comparisons are log N operations. P1 compares N bits, P2 compares N bits, if use P1 unless it's equal then use P2. Short circuting cuts that to log(log(N)) on average and log(N) worst case. It's actually generally faster to compare X bytes of Vary large numbers than X Bytes of long int's. Degenerate case being 2 numbers of x/2 bytes. Anyway, the point is treating log(log(N)) as constant is generally reasonable especially when N is small. |
|