Does Big O Measure Memory Requirments Or Just Speed?

前端 未结 8 1728
孤城傲影
孤城傲影 2021-02-18 16:08

I often here people talk about Big O which measures algorithms against each other

Does this measure clock cycles or space requirements.

If people want to contras

8条回答
  •  旧巷少年郎
    2021-02-18 16:17

    Big O is just a mathematical tool that can be used to describe any function. Usually people use it to describe speed, but it can just as well be used to describe memory usage.

    Also, when we use Big O for time, we're usually not talking directly about clock cycles. Instead, we count "basic operations" (that are implicitly assumed to take a constant number of cycles).

提交回复
热议问题