Advertisement

算法基础:空间和时间复杂度

阅读量:
在这里插入图片描述

本文旨在阐述算法基础中的核心知识点,在时间复杂度和空间复杂度方面进行深入分析。

算法衡量指标

衡量算法的两个重要指标:时间复杂度与空间复杂度。

时间复杂度

定义

为了解决对于时间复杂度的分析和衡量,官方提出了时间复杂度的概念:

Asymptotic time complexity (渐进时间复杂度), also known as asymptotic complexity: For a given function f of n , if the limit \lim_{n \to \infty} \frac{T(n)}{f\left( {n} \right)} = c \ne 0 , then f\left( {n} \right) is said to be in the same asymptotically comparable class as T\left( {n} \right) . This relationship is denoted by \( T\left( {n}

全部评论 (0)

还没有任何评论哟~