Why a programmer would prefer O(N^3) instead of O(N^2)

前端 未结 7 1574
面向向阳花
面向向阳花 2021-01-07 16:57

I was studying for my final exam and there is a question in the archive that I cannot find its answer:

The order-of-growth of the running time of one

7条回答
  •  爱一瞬间的悲伤
    2021-01-07 17:13

    Adding to the already posted answers I'd like to mention cache behaviour. A particular memory access pattern might be so much slower due to repeated cache misses that a theoretically slower algorithm with a more cache friendly memory access pattern performs much better.

提交回复
热议问题