1. Add C++ codes for the chapter of

computational complexity, sorting, searching.
2. Corrected some mistakes.
3. Update README.
This commit is contained in:
Yudong Jin
2022-11-27 04:19:16 +08:00
parent f85ee36ce1
commit 431a0f6caf
37 changed files with 147 additions and 94 deletions

View File

@@ -5,8 +5,9 @@
package chapter_searching
import (
. "github.com/krahets/hello-algo/pkg"
"testing"
. "github.com/krahets/hello-algo/pkg"
)
func TestLinearSearch(t *testing.T) {
@@ -15,10 +16,10 @@ func TestLinearSearch(t *testing.T) {
// 在数组中执行线性查找
index := linerSearchArray(nums, target)
t.Log("目标元素 3 的索引 = ", index)
t.Log("目标元素 3 的索引 =", index)
// 在链表中执行线性查找
head := ArrayToLinkedList(nums)
node := linerSearchLinkedList(head, target)
t.Log("目标结点值 3 的对应结点对象为 ", node)
t.Log("目标结点值 3 的对应结点对象为", node)
}