Hello 算法 1.2.0 简体中文 Kotlin 版Hello 算法 Kotlin 语言版 作者:靳宇栋(@krahets) 代码审阅:陈东辉(@curtishd) Release 1.2.0 2024‑12‑06 序 两年前,我在力扣上分享了“剑指 Offer”系列题解,受到了许多读者的鼓励和支持。在与读者交流期间,我 最常被问的一个问题是“如何入门算法”。逐渐地,我对这个问题产生了浓厚的兴趣。 两眼一抹黑地刷题似乎是最受欢迎的方法 maxHeap.add(_val) // 从底至顶堆化 siftUp(size() - 1) } /* 从节点 i 开始,从底至顶堆化 */ fun siftUp(it: Int) { // Kotlin 的函数参数不可变,因此创建临时变量 var i = it while (true) { // 获取节点 i 的父节点 val p = parent(i) // 当“越过根节点”或“节点无须修复”时,结束堆化 从顶至底堆化 siftDown(0) // 返回堆顶元素 return _val } /* 从节点 i 开始,从顶至底堆化 */ fun siftDown(it: Int) { // Kotlin 的函数参数不可变,因此创建临时变量 var i = it while (true) { // 判断节点 i, l, r 中值最大的节点,记为 ma val l = left(i) val0 码力 | 382 页 | 18.48 MB | 10 月前3
Hello 算法 1.2.0 繁体中文 Kotlin 版Hello 演算法 Kotlin 語言版 作者:靳宇棟(@krahets) 程式碼審閱:陳東輝(@curtishd) Release 1.2.0 2024‑12‑06 序 兩年前,我在力扣上分享了“劍指 Offer”系列題解,受到了許多讀者的鼓勵與支持。在與讀者交流期間,我 最常被問到的一個問題是“如何入門演算法”。漸漸地,我對這個問題產生了濃厚的興趣。 兩眼一抹黑地刷題似乎是最受歡 maxHeap.add(_val) // 從底至頂堆積化 siftUp(size() - 1) } /* 從節點 i 開始,從底至頂堆積化 */ fun siftUp(it: Int) { // Kotlin 的函式參數不可變,因此建立臨時變數 var i = it while (true) { // 獲取節點 i 的父節點 val p = parent(i) // 當“越過根節點”或“節點無須修復”時,結束堆積化 從頂至底堆積化 siftDown(0) // 返回堆積頂元素 return _val } /* 從節點 i 開始,從頂至底堆積化 */ fun siftDown(it: Int) { // Kotlin 的函式參數不可變,因此建立臨時變數 var i = it while (true) { // 判斷節點 i, l, r 中值最大的節點,記為 ma val l = left(i) val0 码力 | 382 页 | 18.79 MB | 10 月前3
Coroutines and Structured Concurrency in Practice• nursery in Python trio • task group in Python asyncio • task scope in Rust • coroutine scope in Kotlin • async_scope in nvidia/stdexec We also call it a nursery (mnemonics: a place where your children0 码力 | 103 页 | 1.98 MB | 6 月前3
2024 中国开源开发者报告56% 17.86% 16.91% 15.63% 15.41% TypeScript Rust YAML Visual Basic Verilog C C++ Python Kotlin C# Dart Arduino TypeScript连续两年成为了 Gitee年度增长最快编程语言 (2023年增长率为49.04%), 同样持续强势的还有Rust以及 C语言家族。0 码力 | 111 页 | 11.44 MB | 8 月前3
Nacos架构&原理
mina 多语言支持 JS 支持 支持 不支持 支持 无 无 Ruby 支持 不支持 不支持 支持 无 无 Python 支持 不支持 不支持 支持 3.6+ >96% 无 无 Kotlin 支持 不支持 不支持 支持 无 无 rust 支持 1.39+ dart 支持 2.6 其他 Github Sta r/Issue 最 高 go 版 本:11.9K/10 码力 | 326 页 | 12.83 MB | 9 月前3
Conan 2.10 Documentationapi_level� In the “Build configuration language” you can choose between Groovy DSL (build.gradle) or Kotlin DSL (build.gradle.kts) in order to use conanInstall task bellow. Select a “C++ Standard” in the Paste the task conanInstall contents after the plugins and before the android elements: Groovy Kotlin Listing 39: build.gradle plugins { ... } task conanInstall { def conanExecutable = "conan" //0 码力 | 803 页 | 5.02 MB | 10 月前3
Conan 2.9 Documentationapi_level� In the “Build configuration language” you can choose between Groovy DSL (build.gradle) or Kotlin DSL (build.gradle.kts) in order to use conanInstall task bellow. Select a “C++ Standard” in the Paste the task conanInstall contents after the plugins and before the android elements: Groovy Kotlin Listing 39: build.gradle plugins { ... } task conanInstall { def conanExecutable = "conan" //0 码力 | 795 页 | 4.99 MB | 10 月前3
Conan 2.7 Documentationapi_level� In the “Build configuration language” you can choose between Groovy DSL (build.gradle) or Kotlin DSL (build.gradle.kts) in order to use conanInstall task bellow. Select a “C++ Standard” in the Paste the task conanInstall contents after the plugins and before the android elements: Groovy Kotlin Listing 39: build.gradle plugins { ... } task conanInstall { def conanExecutable = "conan" //0 码力 | 779 页 | 4.93 MB | 10 月前3
Conan 2.8 Documentationapi_level� In the “Build configuration language” you can choose between Groovy DSL (build.gradle) or Kotlin DSL (build.gradle.kts) in order to use conanInstall task bellow. Select a “C++ Standard” in the Paste the task conanInstall contents after the plugins and before the android elements: Groovy Kotlin Listing 39: build.gradle plugins { ... } task conanInstall { def conanExecutable = "conan" //0 码力 | 785 页 | 4.95 MB | 10 月前3
共 9 条
- 1













