“linear-time”(线性时间)指一种算法的运行时间随输入规模 n 按比例增长,通常记作 **O(n)**。也常用来形容“能在一次线性扫描内完成”的处理方式。(在不同语境下还可能涉及更细的复杂度比较,如常数因子、最坏/平均情况等。)
/ˈlɪniər taɪm/
This algorithm finds the maximum in linear-time.
这个算法以线性时间找出最大值。
With a hash set, the program removes duplicates in linear-time with respect to the number of items, even though the original list is unsorted.
借助哈希集合,程序能在与项目数量成线性关系的时间内去重,即使原始列表是无序的。
“linear”来自拉丁语 linearis(“线的、成直线的”),强调“按直线比例增长”;“time”在计算机科学中常指运行时间。两者组合为“linear-time”,用于算法分析里表示“时间随输入规模线性增长”的复杂度类别。