阮一峰 JavaScript 教程OS、Windows 8 等操作系统直接支持 JavaScript 编 写应用程序。Mozilla 的 Open Web Apps 项目、Google 的 Chrome App 项目、Github 的 Electron 项目、以及 TideSDK 项目,都可以用来编写运行于 Windows、Mac OS 和 Android 等 多个桌面平台的程序,不依赖浏览器。 (7)小结 可以预期,JavaScript 本文档使用 书栈(BookStack.CN) 构建 实例对象与 new 命令 实例对象与 new 命令 对象是什么 构造函数 new 命令 基本用法 new 命令的原理 new.target Object.create() 创建实例对象 JavaScript 语言具有很强的面向对象编程能力,本章介绍 JavaScript 面向对象编程的基础知识。 面向对象编程(Object actor = _new(Person, '张三', 28); 函数内部可以使用 new.target 属性。如果当前函数是 new 命令调 用, new.target 指向当前函数,否则为 undefined 。 1. function f() { 2. console.log(new.target === f); 3. } 4. 5. f() // false 6. new0 码力 | 540 页 | 3.32 MB | 10 月前3
Cache-Friendly Design in Robot Path Planningalgorithm (early stopping) 65Dijkstra's algorithm (early stopping) function Dijkstras(Graph, source, target): for each vertex v in Graph.Vertices: prev[v] ← UNDEFINED # otherwise, set predecessor of (u) if u is target: # end if we are at the target vertex break for each neighbor v of u with prev[v] is 15 16 17 18 19 20 21 66Dijkstra's algorithm (early stopping) function Dijkstras(Graph, source, target): for each vertex v in Graph.Vertices: prev[v] ← UNDEFINED0 码力 | 216 页 | 10.68 MB | 6 月前3
Hello 算法 1.2.0 简体中文 Swift 版=== File: array.swift === /* 在数组中查找指定元素 */ func find(nums: [Int], target: Int) -> Int { for i in nums.indices { if nums[i] == target { return i } } return -1 } 7. 扩容数组 在复杂的系统环境中,程序难以保证数组之后的内存 head } 5. 查找节点 遍历链表,查找其中值为 target 的节点,输出该节点在链表中的索引。此过程也属于线性查找。代码如下所 示: // === File: linked_list.swift === /* 在链表中查找值为 target 的首个节点 */ func find(head: ListNode, target: Int) -> Int { var head: ListNode ListNode? = head var index = 0 while head != nil { if head?.val == target { return index } head = head?.next index += 1 } return -1 } 第 4 章 数组与链表 www.hello‑algo.com 77 4.2.2 数组 vs. 链表 表 4‑10 码力 | 379 页 | 18.48 MB | 10 月前3
Conan 2.10 Documentationand SunOS, and, as it is portable, it might work in any other platform that can run Python. It can target any existing platform: ranging from bare metal to desktop, mobile, embedded, servers, and cross-building shared and managed with conan config install. Deployers run before generators, and they can change the target folders. For example, if the --deployer=full_deploy deployer runs before CMakeDeps, the files generated (continued from previous page) find_package(ZLIB REQUIRED) add_executable(${PROJECT_NAME} src/main.c) target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) Our application relies on the Zlib library. Conan, by0 码力 | 803 页 | 5.02 MB | 10 月前3
Conan 2.9 Documentationand SunOS, and, as it is portable, it might work in any other platform that can run Python. It can target any existing platform: ranging from bare metal to desktop, mobile, embedded, servers, and cross-building shared and managed with conan config install. Deployers run before generators, and they can change the target folders. For example, if the --deployer=full_deploy deployer runs before CMakeDeps, the files generated (continued from previous page) find_package(ZLIB REQUIRED) add_executable(${PROJECT_NAME} src/main.c) target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) Our application relies on the Zlib library. Conan, by0 码力 | 795 页 | 4.99 MB | 10 月前3
Conan 2.6 Documentationand SunOS, and, as it is portable, it might work in any other platform that can run Python. It can target any existing platform: ranging from bare metal to desktop, mobile, embedded, servers, and cross-building shared and managed with conan config install. Deployers run before generators, and they can change the target folders. For example, if the --deployer=full_deploy deployer runs before CMakeDeps, the files generated (continued from previous page) find_package(ZLIB REQUIRED) add_executable(${PROJECT_NAME} src/main.c) target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) Our application relies on the Zlib library. Conan, by0 码力 | 777 页 | 4.91 MB | 10 月前3
Conan 2.7 Documentationand SunOS, and, as it is portable, it might work in any other platform that can run Python. It can target any existing platform: ranging from bare metal to desktop, mobile, embedded, servers, and cross-building shared and managed with conan config install. Deployers run before generators, and they can change the target folders. For example, if the --deployer=full_deploy deployer runs before CMakeDeps, the files generated (continued from previous page) find_package(ZLIB REQUIRED) add_executable(${PROJECT_NAME} src/main.c) target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) Our application relies on the Zlib library. Conan, by0 码力 | 779 页 | 4.93 MB | 10 月前3
Conan 2.8 Documentationand SunOS, and, as it is portable, it might work in any other platform that can run Python. It can target any existing platform: ranging from bare metal to desktop, mobile, embedded, servers, and cross-building shared and managed with conan config install. Deployers run before generators, and they can change the target folders. For example, if the --deployer=full_deploy deployer runs before CMakeDeps, the files generated (continued from previous page) find_package(ZLIB REQUIRED) add_executable(${PROJECT_NAME} src/main.c) target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB) Our application relies on the Zlib library. Conan, by0 码力 | 785 页 | 4.95 MB | 10 月前3
Hello 算法 1.2.0 简体中文 C# 版File: array.cs === /* 在数组中查找指定元素 */ int Find(int[] nums, int target) { for (int i = 0; i < nums.Length; i++) { if (nums[i] == target) return i; } return -1; } 7. 扩容数组 在复杂的系统环境中,程序难以保证数组之后的内存 head; } 5. 查找节点 遍历链表,查找其中值为 target 的节点,输出该节点在链表中的索引。此过程也属于线性查找。代码如下所 示: // === File: linked_list.cs === /* 在链表中查找值为 target 的首个节点 */ int Find(ListNode? head, int target) { int index = 0; while (head (head != null) { if (head.val == target) return index; head = head.next; index++; } return -1; } 4.2.2 数组 vs. 链表 表 4‑1 总结了数组和链表的各项特点并对比了操作效率。由于它们采用两种相反的存储策略,因此各种性质 和操作效率也呈现对立的特点。 表 4‑1 数组与链表的效率对比0 码力 | 379 页 | 18.48 MB | 10 月前3
Hello 算法 1.2.0 简体中文 Dart 版array.dart === /* 在数组中查找指定元素 */ int find(Listnums, int target) { for (var i = 0; i < nums.length; i++) { if (nums[i] == target) return i; } return -1; } 7. 扩容数组 在复杂的系统环境中,程序难以保证数组之后的内存空 head; } 5. 查找节点 遍历链表,查找其中值为 target 的节点,输出该节点在链表中的索引。此过程也属于线性查找。代码如下所 示: // === File: linked_list.dart === /* 在链表中查找值为 target 的首个节点 */ int find(ListNode? head, int target) { int index = 0; while (head (head != null) { if (head.val == target) { return index; } head = head.next; index++; } return -1; } 4.2.2 数组 vs. 链表 表 4‑1 总结了数组和链表的各项特点并对比了操作效率。由于它们采用两种相反的存储策略,因此各种性质 和操作效率也呈现对立的特点。 表 4‑1 数组与链表的效率对比 0 码力 | 378 页 | 18.46 MB | 10 月前3
共 232 条
- 1
- 2
- 3
- 4
- 5
- 6
- 24













