diff --git a/codes/rust/chapter_computational_complexity/leetcode_two_sum.rs b/codes/rust/chapter_computational_complexity/leetcode_two_sum.rs index f6d457309..821d52c92 100644 --- a/codes/rust/chapter_computational_complexity/leetcode_two_sum.rs +++ b/codes/rust/chapter_computational_complexity/leetcode_two_sum.rs @@ -1,7 +1,7 @@ /** * File: leetcode_two_sum.rs * Created Time: 2023-01-14 - * Author: xBLACICEx (xBLACKICEx@outlook.com ) + * Author: xBLACICEx (xBLACKICEx@outlook.com) */ use std::collections::HashMap; diff --git a/codes/rust/chapter_computational_complexity/space_complexity.rs b/codes/rust/chapter_computational_complexity/space_complexity.rs index 37064fcd3..c2327c786 100644 --- a/codes/rust/chapter_computational_complexity/space_complexity.rs +++ b/codes/rust/chapter_computational_complexity/space_complexity.rs @@ -1,9 +1,9 @@ -#![allow(unused_variables)] /** - * File: space_complexity.cpp + * File: space_complexity.rs * Created Time: 2023-01-13 - * Author: xBLACICEx (xBLACKICEx@outlook.com ) + * Author: xBLACICEx (xBLACKICEx@outlook.com) */ +#[allow(unused_variables)] use std::collections::HashMap; diff --git a/codes/rust/chapter_computational_complexity/time_complexity.rs b/codes/rust/chapter_computational_complexity/time_complexity.rs index 942ba471d..6ddacc5c7 100644 --- a/codes/rust/chapter_computational_complexity/time_complexity.rs +++ b/codes/rust/chapter_computational_complexity/time_complexity.rs @@ -1,9 +1,9 @@ -#![allow(unused_variables)] /** - * File: time_complexity.cpp + * File: time_complexity.rs * Created Time: 2023-01-10 - * Author: xBLACICEx (xBLACKICEx@outlook.com ) + * Author: xBLACICEx (xBLACKICEx@outlook.com) */ +#[allow(unused_variables)] /* 常数阶 */ fn constant(n: i32) -> i32 { @@ -98,6 +98,7 @@ fn logarithmic(mut n: i32) -> i32 { count } +/* 对数阶(递归实现) */ fn log_recur(n: i32) -> i32 { if n <= 1 { return 0; diff --git a/codes/rust/chapter_computational_complexity/worst_best_time_complexity.rs b/codes/rust/chapter_computational_complexity/worst_best_time_complexity.rs index 23c2d646e..179d358d1 100644 --- a/codes/rust/chapter_computational_complexity/worst_best_time_complexity.rs +++ b/codes/rust/chapter_computational_complexity/worst_best_time_complexity.rs @@ -1,10 +1,10 @@ -// rand = "0.8.5" /** - * File: time_complexity.cpp + * File: time_complexity.rs * Created Time: 2023-01-13 - * Author: xBLACICEx (xBLACKICEx@outlook.com ) + * Author: xBLACICEx (xBLACKICEx@outlook.com) */ +// rand = "0.8.5" // to compilse and run this singile file need: // 1. cargo install cargo-single // 2. cargo single run worst_best_time_complexity.rs