From 29ae658deade0c8b7b02e4860159569653efeaca Mon Sep 17 00:00:00 2001 From: krahets Date: Wed, 1 Mar 2023 03:17:07 +0800 Subject: [PATCH] Fix code formats. --- .../time_complexity.md | 12 ++++++------ docs/chapter_hashing/hash_map.md | 9 ++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/chapter_computational_complexity/time_complexity.md b/docs/chapter_computational_complexity/time_complexity.md index 2a05508f8..a768df4e2 100755 --- a/docs/chapter_computational_complexity/time_complexity.md +++ b/docs/chapter_computational_complexity/time_complexity.md @@ -440,7 +440,7 @@ $$ === "JavaScript" ```javascript title="" - function algorithm(n){ + function algorithm(n) { var a = 1; // +1 a += 1; // +1 a *= 2; // +1 @@ -448,7 +448,6 @@ $$ for(let i = 0; i < n; i++){ // +1(每轮都执行 i ++) console.log(0); // +1 } - } ``` @@ -463,7 +462,6 @@ $$ for(let i = 0; i < n; i++){ // +1(每轮都执行 i ++) console.log(0); // +1 } - } ``` @@ -484,13 +482,15 @@ $$ === "C#" ```csharp title="" - void algorithm(int n) { + void algorithm(int n) + { int a = 1; // +1 a = a + 1; // +1 a = a * 2; // +1 // 循环 n 次 - for (int i = 0; i < n; i++) { // +1(每轮都执行 i ++) - Console.WriteLine(0); // +1 + for (int i = 0; i < n; i++) // +1(每轮都执行 i ++) + { + Console.WriteLine(0); // +1 } } ``` diff --git a/docs/chapter_hashing/hash_map.md b/docs/chapter_hashing/hash_map.md index 4a59bcf62..11359748e 100755 --- a/docs/chapter_hashing/hash_map.md +++ b/docs/chapter_hashing/hash_map.md @@ -348,15 +348,18 @@ ```csharp title="hash_map.cs" /* 遍历哈希表 */ // 遍历键值对 Key->Value - foreach (var kv in map) { + foreach (var kv in map) + { Console.WriteLine(kv.Key + " -> " + kv.Value); } // 单独遍历键 key - foreach (int key in map.Keys) { + foreach (int key in map.Keys) + { Console.WriteLine(key); } // 单独遍历值 value - foreach (String val in map.Values) { + foreach (String val in map.Values) + { Console.WriteLine(val); } ```