Hello 算法 1.2.0 繁体中文 Go 版Hello 演算法 Go 語言版 作者:靳宇棟(@krahets) 程式碼審閱:劉代富(@Reanon) Release 1.2.0 2024‑12‑06 序 兩年前,我在力扣上分享了“劍指 Offer”系列題解,受到了許多讀者的鼓勵與支持。在與讀者交流期間,我 最常被問到的一個問題是“如何入門演算法”。漸漸地,我對這個問題產生了濃厚的興趣。 兩眼一抹黑地刷題似乎是最受歡迎的方法,簡 與輸入資料大小之間的關係。它描述了隨著輸入資料 大小的增加,演算法執行所需時間和空間的增長趨勢。這個定義有些拗口,我們可以將其分為三個重點來理 解。 ‧“時間和空間資源”分別對應時間複雜度(time complexity)和空間複雜度(space complexity)。 ‧“隨著輸入資料大小的增加”意味著複雜度反映了演算法執行效率與輸入資料體量之間的關係。 ‧“時間和空間的增長趨勢”表 記錄。需要注意的是,Python 中 range(a, b) 對應的區間是“左閉右開”的,對應的走訪範圍為 ?, ? + 1, … , ? − 1 : // === File: iteration.go === /* for 迴圈 */ func forLoop(n int) int { res := 0 // 迴圈求和 1, 2, ..., n-1, n for i := 1; i <=0 码力 | 385 页 | 18.80 MB | 10 月前3
julia 1.10.10variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 34.3 Measure performance with @time and pay attention to memory allocation . . . . . . 417 34.4 Tools . . . . . . . . . . . . . . . dispatch, and good performance, achieved using type inference and just-in-time (JIT) compilation (and optional ahead-of-time compilation), implemented using LLVM. It is multi-paradigm, combining features annotate types for the compiler, types exist only at compile time and cannot be manipulated or expressed at run time. In Julia, types are themselves run-time objects, and can also be used to convey information0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 34.3 Measure performance with @time and pay attention to memory allocation . . . . . . 417 34.4 Tools . . . . . . . . . . . . . . . dispatch, and good performance, achieved using type inference and just-in-time (JIT) compilation (and optional ahead-of-time compilation), implemented using LLVM. It is multi-paradigm, combining features annotate types for the compiler, types exist only at compile time and cannot be manipulated or expressed at run time. In Julia, types are themselves run-time objects, and can also be used to convey information0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.6 Release Notesvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 35.3 Measure performance with @time and pay attention to memory allocation . . . . . . 445 35.4 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 35.31 Execution latency, package loading and package precompiling time . . . . . . . . . 476 36 Workflow Tips 479 36.1 REPL-based workflow . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1896 105.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1913 105.26 Static analyzer0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.4variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 35.3 Measure performance with @time and pay attention to memory allocation . . . . . . 445 35.4 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 35.31 Execution latency, package loading and package precompiling time . . . . . . . . . 476 36 Workflow Tips 479 36.1 REPL-based workflow . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1896 105.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1913 105.26 Static analyzer0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationvariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 35.3 Measure performance with @time and pay attention to memory allocation . . . . . . 445 35.4 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476 35.31 Execution latency, package loading and package precompiling time . . . . . . . . . 476 36 Workflow Tips 479 36.1 REPL-based workflow . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1896 105.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1913 105.26 Static analyzer0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.12.0 RC1Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 33.5 Wall-time Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 33.6 Memory . . . . . . . . . . . . . . 475 35.5 Execution latency, package loading and package precompiling time . . . . . . . . . 482 35.6 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1947 106.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1963 106.26 Static analyzer0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta4Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 33.5 Wall-time Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 33.6 Memory . . . . . . . . . . . . . . 474 35.5 Execution latency, package loading and package precompiling time . . . . . . . . . 481 35.6 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1947 106.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1963 106.26 Static analyzer0 码力 | 2057 页 | 7.44 MB | 3 月前3
Julia 1.12.0 Beta3Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 33.5 Wall-time Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 33.6 Memory . . . . . . . . . . . . . . 474 35.5 Execution latency, package loading and package precompiling time . . . . . . . . . 481 35.6 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1947 106.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1963 106.26 Static analyzer0 码力 | 2057 页 | 7.44 MB | 3 月前3
julia 1.12.0 beta1Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 33.5 Wall-time Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 33.6 Memory . . . . . . . . . . . . . . 474 35.5 Execution latency, package loading and package precompiling time . . . . . . . . . 481 35.6 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . EscapeAnalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1938 105.25 Ahead of Time Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1954 105.26 Static analyzer0 码力 | 2047 页 | 7.41 MB | 3 月前3
共 37 条
- 1
- 2
- 3
- 4













