|
|
|
|
|
by rawnlq
4250 days ago
|
|
Cool you seem to be the author. Instead of telling people that it's O(log n) you should just show benchmarks instead. Hitting L1 takes 1ns but main memory takes 100ns. So although you can say accessing an element in an array is always O(1) = O(100), it is hiding a factor of a 100 depending on how it is accessed. Having a log in the big Oh usually means it is jumping around a lot and is no longer a cache friendly algorithm, so that worries me more than whether it is log_2(x) or log_2(x)/5. |
|