Hello 算法 1.0.0b4 C#版对于以下算法,尽管操作数量 size 可能很大,但由于其与数据大小 ? 无关,因此时间复杂度仍为 ?(1) 。 2. 复杂度 hello‑algo.com 20 // === File: time_complexity.cs === /* 常数阶 */ int constant(int n) { int count = 0; int size = 100000; for (int i = 0; i < size; return count; } 线性阶 ?(?) 线性阶的操作数量相对于输入数据大小以线性级别增长。线性阶通常出现在单层循环中。 // === File: time_complexity.cs === /* 线性阶 */ int linear(int n) { int count = 0; for (int i = 0; i < n; i++) count++; return 需根据输入数据的类型来具体确定。例如,在上述示例中,我们直接将 ? 视为输 入数据大小;在下面遍历数组的示例中,数据大小 ? 为数组的长度。 // === File: time_complexity.cs === /* 线性阶(遍历数组) */ int arrayTraversal(int[] nums) { int count = 0; // 循环次数与数组长度成正比 foreach (int0 码力 | 341 页 | 27.39 MB | 1 年前3
Hello 算法 1.1.0 C#版记录。需要注意的是,Python 中 range(a, b) 对应的区间是“左闭右开”的,对应的遍历范围为 ?, ? + 1, … , ? − 1 : // === File: iteration.cs === /* for 循环 */ int ForLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i 循环中,程序每轮都会先检查条件,如果条 件为真,则继续执行,否则就结束循环。 下面我们用 while 循环来实现求和 1 + 2 + ⋯ + ? : // === File: iteration.cs === /* while 循环 */ int WhileLoop(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 1, 2, .. 例如在以下代码中,条件变量 ? 每轮进行两次更新,这种情况就不太方便用 for 循环实现: 第 2 章 复杂度分析 hello‑algo.com 21 // === File: iteration.cs === /* while 循环(两次更新) */ int WhileLoopII(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 10 码力 | 378 页 | 18.47 MB | 1 年前3
Hello 算法 1.2.0 简体中文 C# 版记录。需要注意的是,Python 中 range(a, b) 对应的区间是“左闭右开”的,对应的遍历范围为 ?, ? + 1, … , ? − 1 : // === File: iteration.cs === /* for 循环 */ int ForLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i 循环中,程序每轮都会先检查条件,如果条 件为真,则继续执行,否则就结束循环。 下面我们用 while 循环来实现求和 1 + 2 + ⋯ + ? : // === File: iteration.cs === /* while 循环 */ int WhileLoop(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 1, 2, .. 复杂度分析 www.hello‑algo.com 21 例如在以下代码中,条件变量 ? 每轮进行两次更新,这种情况就不太方便用 for 循环实现: // === File: iteration.cs === /* while 循环(两次更新) */ int WhileLoopII(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 10 码力 | 379 页 | 18.48 MB | 10 月前3
Hello 算法 1.0.0 C#版记录。需要注意的是,Python 中 range(a, b) 对应的区间是“左闭右开”的,对应的遍历范围为 ?, ? + 1, … , ? − 1 : // === File: iteration.cs === /* for 循环 */ int ForLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i 循环中,程序每轮都会先检查条件,如果条 件为真,则继续执行,否则就结束循环。 下面我们用 while 循环来实现求和 1 + 2 + ⋯ + ? : // === File: iteration.cs === /* while 循环 */ int WhileLoop(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 1, 2, .. 2 章 复杂度分析 hello‑algo.com 21 例如在以下代码中,条件变量 ? 每轮进行两次更新,这种情况就不太方便用 for 循环实现: // === File: iteration.cs === /* while 循环(两次更新) */ int WhileLoopII(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 10 码力 | 376 页 | 17.59 MB | 1 年前3
Hello 算法 1.0.0b5 C#版记录。需要注意的是,Python 中 range(a, b) 对应的区间是“左闭右开”的,对应的遍历范围为 ?, ? + 1, … , ? − 1 。 // === File: iteration.cs === /* for 循环 */ int forLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i 循环中,程序每轮都会先检查条件,如果条 件为真则继续执行,否则就结束循环。 下面,我们用 while 循环来实现求和 1 + 2 + ⋯ + ? 。 // === File: iteration.cs === /* while 循环 */ int whileLoop(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 1, 2, .. 2 章 复杂度分析 hello‑algo.com 20 例如在以下代码中,条件变量 ? 每轮进行了两次更新,这种情况就不太方便用 for 循环实现。 // === File: iteration.cs === /* while 循环(两次更新) */ int whileLoopII(int n) { int res = 0; int i = 1; // 初始化条件变量 // 循环求和 10 码力 | 376 页 | 30.69 MB | 1 年前3
Hello 算法 1.2.0 繁体中文 C# 版記錄。需要注意的是,Python 中 range(a, b) 對應的區間是“左閉右開”的,對應的走訪範圍為 ?, ? + 1, … , ? − 1 : // === File: iteration.cs === /* for 迴圈 */ int ForLoop(int n) { int res = 0; // 迴圈求和 1, 2, ..., n-1, n for (int i = 1; i 迴圈中,程式每輪都會先檢查條件,如果條 件為真,則繼續執行,否則就結束迴圈。 下面我們用 while 迴圈來實現求和 1 + 2 + ⋯ + ? : // === File: iteration.cs === /* while 迴圈 */ int WhileLoop(int n) { int res = 0; int i = 1; // 初始化條件變數 // 迴圈求和 1, 2, .. 複雜度分析 www.hello‑algo.com 21 例如在以下程式碼中,條件變數 ? 每輪進行兩次更新,這種情況就不太方便用 for 迴圈實現: // === File: iteration.cs === /* while 迴圈(兩次更新) */ int WhileLoopII(int n) { int res = 0; int i = 1; // 初始化條件變數 // 迴圈求和 10 码力 | 379 页 | 18.79 MB | 10 月前3
《深入浅出MFC》2/e这本比较好~~~不过之前最好买侯老师的多 型与虚拟拟,把C++ 弄清楚。最后看起深入Visual C++ 就会吸收很快。 请问,想要从DOS 跨足到Windows 程序设计有哪些书值得推荐呢? hschin.bbs@bbs.cs.nthu.edu.tw:建议你看侯俊杰的深入浅出MFC,里面除了对窗口程序 的架构作基础性的说明,让你了解一些基础概论,也说了不少窗口程序设计的课题,是 非常不错的一本书。 xiii News ncu:侯俊杰的深入Visual C++(Inside visual C++ 中译本)不错, 适合初学者对MFC 做初步的认识与应用。深入浅出MFC 这一本原理讲的较多。 Sagitta.bbs@firebird.cs.ccu.edu.tw:Inside Visual C++ 4.0 不是初学者用的书,因为它未从 最基本观念讲起。深入浅出MFC 前半本都在描述(或说仿真) MFC 的内部技术,甚至挖 出MFC InitApplication(HINSTANCE hInstance) #0047 { #0048 WNDCLASS wc; #0049 #0050 wc.style = CS_HREDRAW | CS_VREDRAW; #0051 wc.lpfnWndProc = (WNDPROC)WndProc; // #0052 wc.cbClsExtra = 0;0 码力 | 1009 页 | 11.08 MB | 1 年前3
Adventures in SIMD Thinking (Part 2 of 2)© 2020 Bob Steagall K E W B C O M P U T I N G 33 CppCon 2020 - Adventures in SIMD Thinking CS1 CS2 CS3 P4B P4A P3B P3A ERR BGN The UTF-8 Decoding DFA 00..7F C2..DF E0..E0 ED..ED F0..F0 © 2020 Bob Steagall K E W B C O M P U T I N G 36 CppCon 2020 - Adventures in SIMD Thinking CS1 CS2 CS3 P4B P4A P3B P3A ERR BGN A Decoding Example – { .. E2 88 85 .. } 00..7F C2..DF E0 © 2020 Bob Steagall K E W B C O M P U T I N G 42 CppCon 2020 - Adventures in SIMD Thinking CS1 CS2 CS3 P4B P4A P3B P3A ERR BGN A Decoding Example – { .. E2 88 85 .. } 00..7F C2..DF E00 码力 | 135 页 | 551.08 KB | 6 月前3
PyMuPDF 1.12.2 documentationConstructor Parameters: n (int) – A number identifying the colorspace. Possible values are CS_RGB, CS_GRAY and CS_CMYK. name The name identifying the colorspace. Example: fitz.csCMYK.name = 'DeviceCMYK' for the three available cases. csRGB = fitz.Colorspace(fitz.CS_RGB) csGRAY = fitz.Colorspace(fitz.CS_GRAY) csCMYK = fitz.Colorspace(fitz.CS_CMYK) index next | previous | PyMuPDF 1.12.2 documentation color provided as a value triple (red, green, blue). Only colorspaces CS_GRAY and CS_RGB are supported. If the colorspace is CS_GRAY, (red + green + blue)/3 will be taken as the tinting value. Parameters:0 码力 | 387 页 | 2.70 MB | 1 年前3
peewee Documentation Release 2.10.2remove(Course.select().where(Course.name.startswith('CS')) ) engl_101.students.remove(huey) # Calling .clear() will remove all associated objects: cs_150.students.clear() For more examples, see: ManyToManyField = Student.get(Student.name == 'huey') >>> [course.name for course in huey.courses] ['English 101', 'CS 101'] >>> engl_101 = Course.get(Course.name == 'English 101') >>> [student.name for student in engl_101 English 151 English 201 English 221 >>> cs_101 = Course.get(Course.name == 'CS 101') >>> cs_151 = Course.get(Course.name == 'CS 151') >>> huey.courses.add([cs_101, cs_151]) >>> [course.name for course in0 码力 | 275 页 | 276.96 KB | 1 年前3
共 478 条
- 1
- 2
- 3
- 4
- 5
- 6
- 48













