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

前端 未结 7 1591
面向向阳花
面向向阳花 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:25

    The only reason for choosing one algorithm is not the order-of-growth of the running time. You must analyze:

    • How easy it is to implement
    • The space required
    • How big are the real life inputs (sometimes the time difference is only observable for input sizes that never occurs in reality)

提交回复
热议问题