Refine some details and coding style for Rust codes (#344)

* Refine some details and coding style for Rust codes

* Update coding style for Rust codes

* Update time_complexity.rs

* Update array.rs

* Update leetcode_two_sum.rs

* Update hash_map.rs

* Update file headers

* Update coding style for Rust codes and Zig codes

* Update coding style for Rust codes and Zig codes

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
sjinzh
2023-02-09 00:25:01 +08:00
committed by GitHub
parent 6dc21691ed
commit e65c7bd478
20 changed files with 189 additions and 177 deletions
+6 -4
View File
@@ -1,8 +1,10 @@
/**
/*
* File: bubble_sort.rs
* Created Time: 2023-02-05
* Author: sjinzh (sjinzh@gmail.com)
*/
*/
include!("../include/include.rs");
/* 冒泡排序 */
fn bubble_sort(nums: &mut [i32]) {
@@ -44,10 +46,10 @@ pub fn main() {
let mut nums = [ 4, 1, 3, 1, 5, 2 ];
bubble_sort(&mut nums);
print!("冒泡排序完成后 nums = ");
inc::print_util::print_array(&nums);
print_util::print_array(&nums);
let mut nums1 = [ 4, 1, 3, 1, 5, 2 ];
bubble_sort_with_flag(&mut nums1);
print!("\n冒泡排序完成后 nums1 = ");
inc::print_util::print_array(&nums1);
print_util::print_array(&nums1);
}