时间复杂度(Time complexity)

简介(Introduction)

时间复杂度( Time complexity ) 是一个函数,它定性描述该算法的运行时间

时间复杂度常用 \(O\) 表示法 表示



描述(Description)

  • \(C++\) 一秒操作次数在 \(10^7 \sim 10^8\) 左右

    \[n≤30 \to 指数级别 \]

    \[n≤100 \to O(n^3) \]

    \[n≤1000 => O(n^2)\ \ \ | \ \ \ O(n^2logn) \]

    \[n≤10000 \to O(n∗ \sqrt{n}) \]

    \[n≤10^5 \to O(nlogn) \]

    \[n≤10^7 \to O(n) \]

    \[n ≤ 10^9 \to O(\sqrt{n} ) \]

    \[n≤10^{18} \to O(logn)\ \ \ \ 二分 \]

    \[数据范围超过\ \ long\ \ long \ \ 时,需要高精度 \]


posted @ 2023-05-17 12:52  FFex  阅读(12)  评论(0编辑  收藏  举报