mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 01:56:31 +08:00
🌈 style(codes/rust): fix comment style and miss comment
This commit is contained in:
parent
9b39d1577e
commit
16e4af08b6
4 changed files with 11 additions and 10 deletions
|
@ -1,9 +1,9 @@
|
||||||
#![allow(unused_variables)]
|
|
||||||
/**
|
/**
|
||||||
* File: space_complexity.cpp
|
* File: space_complexity.rs
|
||||||
* Created Time: 2023-01-13
|
* Created Time: 2023-01-13
|
||||||
* Author: xBLACICEx (xBLACKICEx@outlook.com)
|
* Author: xBLACICEx (xBLACKICEx@outlook.com)
|
||||||
*/
|
*/
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#![allow(unused_variables)]
|
|
||||||
/**
|
/**
|
||||||
* File: time_complexity.cpp
|
* File: time_complexity.rs
|
||||||
* Created Time: 2023-01-10
|
* Created Time: 2023-01-10
|
||||||
* Author: xBLACICEx (xBLACKICEx@outlook.com)
|
* Author: xBLACICEx (xBLACKICEx@outlook.com)
|
||||||
*/
|
*/
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
|
||||||
/* 常数阶 */
|
/* 常数阶 */
|
||||||
fn constant(n: i32) -> i32 {
|
fn constant(n: i32) -> i32 {
|
||||||
|
@ -98,6 +98,7 @@ fn logarithmic(mut n: i32) -> i32 {
|
||||||
count
|
count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 对数阶(递归实现) */
|
||||||
fn log_recur(n: i32) -> i32 {
|
fn log_recur(n: i32) -> i32 {
|
||||||
if n <= 1 {
|
if n <= 1 {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// rand = "0.8.5"
|
|
||||||
/**
|
/**
|
||||||
* File: time_complexity.cpp
|
* File: time_complexity.rs
|
||||||
* Created Time: 2023-01-13
|
* 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:
|
// to compilse and run this singile file need:
|
||||||
// 1. cargo install cargo-single
|
// 1. cargo install cargo-single
|
||||||
// 2. cargo single run worst_best_time_complexity.rs
|
// 2. cargo single run worst_best_time_complexity.rs
|
||||||
|
|
Loading…
Reference in a new issue