It depends on the platform, but almost surely reading values from memory is more expensive than the operations on the CPU. But, on the topic of big o notation - it's not about which operation is more expensive. It's about the fact that the algorithm scales with the number of inputs (i.e. n).
Asked in February 2016Viewed 2,264 timesVoted 5Answered 1 times