Add Go codes to docs, including

the chapter of stack and queue, the chapter of tree.
This commit is contained in:
Yudong Jin
2022-12-03 20:25:24 +08:00
parent 1d9a076cdd
commit ebf9024136
41 changed files with 898 additions and 486 deletions

View File

@@ -5,6 +5,7 @@
package chapter_computational_complexity
import (
"fmt"
"testing"
)
@@ -16,8 +17,8 @@ func TestTwoSum(t *testing.T) {
// ====== Driver Code ======
// 方法一:暴力解法
res := twoSumBruteForce(nums, target)
t.Log("方法一 res =", res)
fmt.Println("方法一 res =", res)
// 方法二:哈希表
res = twoSumHashTable(nums, target)
t.Log("方法二 res =", res)
fmt.Println("方法二 res =", res)
}