mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-13 07:46:06 +00:00
Bug fixes and improvements (#1380)
* preorder, inorder, postorder -> pre-order, in-order, post-order * Bug fixes * Bug fixes * Update what_is_dsa.md * Sync zh and zh-hant versions * Sync zh and zh-hant versions. * Update performance_evaluation.md and time_complexity.md * Add @khoaxuantu to the landing page. * Sync zh and zh-hant versions * Add @ khoaxuantu to the landing page of zh-hant and en versions.
This commit is contained in:
@@ -95,9 +95,9 @@
|
||||
/* 初始化陣列 */
|
||||
let arr: [i32; 5] = [0; 5]; // [0, 0, 0, 0, 0]
|
||||
let slice: &[i32] = &[0; 5];
|
||||
// 在 Rust 中,指定長度时([i32; 5])爲陣列,不指定長度時(&[i32])爲切片
|
||||
// 在 Rust 中,指定長度時([i32; 5])為陣列,不指定長度時(&[i32])為切片
|
||||
// 由於 Rust 的陣列被設計為在編譯期確定長度,因此只能使用常數來指定長度
|
||||
// Vector 是 Rust 一般情況下用作動態陣列的類型
|
||||
// Vector 是 Rust 一般情況下用作動態陣列的型別
|
||||
// 為了方便實現擴容 extend() 方法,以下將 vector 看作陣列(array)
|
||||
let nums: Vec<i32> = vec![1, 3, 2, 5, 4];
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user