Hello 算法 1.0.0b1 Python版理论估算 既然实际测试具有很大的局限性,那么我们是否可以仅通过一些计算,就获知算法的效率水平呢?答案 是肯定的,我们将此估算方法称为「复杂度分析 Complexity Analysis」或「渐近复杂度分析 Asymptotic Complexity Analysis」。 复杂度分析评估的是算法运行效率随着输入数据量增多时的增长趋势。这句话有些拗口,我们可以将其分为三 个重点来理解: 2. 复杂度分析 hello‑algo.com 13 ‧“算法运行效率”可分为“运行时间”和“占用空间”,进而可将复杂度分为「时间复杂度 Time Complexity」 和「空间复杂度 Space Complexity」。 ‧“随着输入数据量增多时”代表复杂度与输入数据量有关,反映算法运行效率与输入数据量之间的关系; ‧“增长趋势”表示复杂度分析不关心算法具体使用了多少时间或占用了多少空间,而是给出一种“趋势性 复杂度分析 hello‑algo.com 19 对于以下算法,无论操作数量 size 有多大,只要与数据大小 ? 无关,时间复杂度就仍为 ?(1) 。 # === File: time_complexity.py === def constant(n): """ 常数阶 """ count = 0 size = 100000 for _ in range(size): count +=0 码力 | 178 页 | 14.67 MB | 1 年前3
Hello 算法 1.0.0b2 Python版理论估算 既然实际测试具有很大的局限性,那么我们是否可以仅通过一些计算,就获知算法的效率水平呢?答案 是肯定的,我们将此估算方法称为「复杂度分析 Complexity Analysis」或「渐近复杂度分析 Asymptotic Complexity Analysis」。 复杂度分析评估的是算法运行效率随着输入数据量增多时的增长趋势。这句话有些拗口,我们可以将其分为三 个重点来理解: 2. 复杂度分析 hello‑algo.com 13 ‧“算法运行效率”可分为“运行时间”和“占用空间”,进而可将复杂度分为「时间复杂度 Time Complexity」 和「空间复杂度 Space Complexity」。 ‧“随着输入数据量增多时”代表复杂度与输入数据量有关,反映算法运行效率与输入数据量之间的关系; ‧“增长趋势”表示复杂度分析不关心算法具体使用了多少时间或占用了多少空间,而是给出一种“趋势性 复杂度分析 hello‑algo.com 19 对于以下算法,无论操作数量 size 有多大,只要与数据大小 ? 无关,时间复杂度就仍为 ?(1) 。 # === File: time_complexity.py === def constant(n: int) -> int: """ 常数阶 """ count: int = 0 size: int = 100000 for _ in0 码力 | 186 页 | 15.69 MB | 1 年前3
Hello 算法 1.1.0 Python版为渐近复杂度分析(asymptotic complexity analysis),简称复杂度分析。 复杂度分析能够体现算法运行所需的时间和空间资源与输入数据大小之间的关系。它描述了随着输入数据大 小的增加,算法执行所需时间和空间的增长趋势。这个定义有些拗口,我们可以将其分为三个重点来理解。 ‧“时间和空间资源”分别对应时间复杂度(time complexity)和空间复杂度(space complexity)。 ‧“ 无关,即不随着 ? 的变化而变化。 在以下函数中,尽管操作数量 size 可能很大,但由于其与输入数据大小 ? 无关,因此时间复杂度仍为 ?(1) : # === File: time_complexity.py === def constant(n: int) -> int: 第 2 章 复杂度分析 hello‑algo.com 33 """ 常数阶""" count = 0 size File: time_complexity.py === def linear(n: int) -> int: """ 线性阶""" count = 0 for _ in range(n): count += 1 return count 遍历数组和遍历链表等操作的时间复杂度均为 ?(?) ,其中 ? 为数组或链表的长度: # === File: time_complexity.py ===0 码力 | 364 页 | 18.42 MB | 1 年前3
Hello 算法 1.0.0 Python版asymptotic complexity analysis」,简称「复杂度分析」。 复杂度分析能够体现算法运行所需的时间和空间资源与输入数据大小之间的关系。它描述了随着输入数据大 小的增加,算法执行所需时间和空间的增长趋势。这个定义有些拗口,我们可以将其分为三个重点来理解。 ‧“时间和空间资源”分别对应「时间复杂度 time complexity」和「空间复杂度 space complexity」。 在以下函数中,尽管操作数量 size 可能很大,但由于其与输入数据大小 ? 无关,因此时间复杂度仍为 ?(1) : 第 2 章 复杂度分析 hello‑algo.com 33 # === File: time_complexity.py === def constant(n: int) -> int: """ 常数阶""" count = 0 size = 100000 for _ in range(size): File: time_complexity.py === def linear(n: int) -> int: """ 线性阶""" count = 0 for _ in range(n): count += 1 return count 遍历数组和遍历链表等操作的时间复杂度均为 ?(?) ,其中 ? 为数组或链表的长度: # === File: time_complexity.py ===0 码力 | 362 页 | 17.54 MB | 1 年前3
Hello 算法 1.0.0b4 Python版「复杂度分析 Complexity Analysis」或「渐近复杂度分析 Asymptotic Complexity Analysis」。 复杂度分析评估的是算法运行效率随着输入数据量增多时的增长趋势。这个定义有些拗口,我们可以将其分 为三个重点来理解: ‧“算法运行效率”可分为“运行时间”和“占用空间”,因此我们可以将复杂度分为「时间复杂度 Time Complexity」和「空间复杂度 Complexity」和「空间复杂度 Space Complexity」。 2. 复杂度 hello‑algo.com 14 ‧“随着输入数据量增多时”表示复杂度与输入数据量有关,反映了算法运行效率与输入数据量之间的关 系。 ‧“增长趋势”表示复杂度分析关注的是算法时间与空间的增长趋势,而非具体的运行时间或占用空间。 复杂度分析克服了实际测试方法的弊端。首先,它独立于测试环境,因此分析结果适用于所有运行平台。其 次,它可 ? 无关,即不随着 ? 的变化而变化。 对于以下算法,尽管操作数量 size 可能很大,但由于其与数据大小 ? 无关,因此时间复杂度仍为 ?(1) 。 # === File: time_complexity.py === def constant(n: int) -> int: """ 常数阶""" count = 0 size = 100000 for _ in range(size):0 码力 | 329 页 | 27.34 MB | 1 年前3
Hello 算法 1.2.0 简体中文 Python 版为渐近复杂度分析(asymptotic complexity analysis),简称复杂度分析。 复杂度分析能够体现算法运行所需的时间和空间资源与输入数据大小之间的关系。它描述了随着输入数据大 小的增加,算法执行所需时间和空间的增长趋势。这个定义有些拗口,我们可以将其分为三个重点来理解。 ‧“时间和空间资源”分别对应时间复杂度(time complexity)和空间复杂度(space complexity)。 ‧“ 无关,即不随着 ? 的变化而变化。 在以下函数中,尽管操作数量 size 可能很大,但由于其与输入数据大小 ? 无关,因此时间复杂度仍为 ?(1) : # === File: time_complexity.py === def constant(n: int) -> int: 第 2 章 复杂度分析 www.hello‑algo.com 33 """ 常数阶""" count = 0 File: time_complexity.py === def linear(n: int) -> int: """ 线性阶""" count = 0 for _ in range(n): count += 1 return count 遍历数组和遍历链表等操作的时间复杂度均为 ?(?) ,其中 ? 为数组或链表的长度: # === File: time_complexity.py ===0 码力 | 364 页 | 18.43 MB | 10 月前3
Hello 算法 1.0.0b5 Python版asymptotic complexity analysis」,简称「复杂度分析」。 复杂度分析体现算法运行所需的时间(空间)资源与输入数据大小之间的关系。它描述了随着输入数据大小 的增加,算法执行所需时间和空间的增长趋势。这个定义有些拗口,我们可以将其分为三个重点来理解。 ‧“时间和空间资源”分别对应「时间复杂度 time complexity」和「空间复杂度 space complexity」。 ‧ 无关,即不随着 ? 的变化而变化。 在以下函数中,尽管操作数量 size 可能很大,但由于其与输入数据大小 ? 无关,因此时间复杂度仍为 ?(1) : # === File: time_complexity.py === def constant(n: int) -> int: """ 常数阶""" 第 2 章 复杂度分析 hello‑algo.com 31 count = 0 size File: time_complexity.py === def linear(n: int) -> int: """ 线性阶""" count = 0 for _ in range(n): count += 1 return count 遍历数组和遍历链表等操作的时间复杂度均为 ?(?) ,其中 ? 为数组或链表的长度: # === File: time_complexity.py ===0 码力 | 361 页 | 30.64 MB | 1 年前3
Hello 算法 1.2.0 繁体中文 Python 版稱為漸近複雜度分析(asymptotic complexity analysis),簡稱複雜度分析。 複雜度分析能夠體現演算法執行所需的時間和空間資源與輸入資料大小之間的關係。它描述了隨著輸入資料 大小的增加,演算法執行所需時間和空間的增長趨勢。這個定義有些拗口,我們可以將其分為三個重點來理 解。 ‧“時間和空間資源”分別對應時間複雜度(time complexity)和空間複雜度(space complexity)。 無關,即不隨著 ? 的變化而變化。 在以下函式中,儘管操作數量 size 可能很大,但由於其與輸入資料大小 ? 無關,因此時間複雜度仍為 ?(1) : # === File: time_complexity.py === def constant(n: int) -> int: 第 2 章 複雜度分析 www.hello‑algo.com 33 """ 常數階""" count = 0 time_complexity.py === def linear(n: int) -> int: """ 線性階""" count = 0 for _ in range(n): count += 1 return count 走訪陣列和走訪鏈結串列等操作的時間複雜度均為 ?(?) ,其中 ? 為陣列或鏈結串列的長度: # === File: time_complexity.py ===0 码力 | 364 页 | 18.74 MB | 10 月前3
Objeet Oriented Python
Tutorial0x036A8E10> Encapsulation Encapsulation is one of the fundamentals of OOP. OOP enables us to hide the complexity of the internal working of the object which is advantageous to the developer in the following Multiple inheritance refers to the ability of inheriting from two or more than two class. The complexity arises as child inherits from parent and parents inherits from the grandparent class. Python climbs0 码力 | 111 页 | 3.32 MB | 1 年前3
MuPDF 1.22.0 Documentationfz_drop_pixmap(ctx, pix); fz_drop_document(ctx, doc); fz_drop_context(ctx); return EXIT_SUCCESS; } To limit the complexity and give an easier introduction this code has no error handling at all, but any serious piece of introduce more and more compatibility veneers, ultimately leading to a bloated API and additional complexity. We have done this in the past, and will do it again in future if circumstances demand it, but0 码力 | 175 页 | 698.87 KB | 8 月前3
共 153 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16













