Skip to content

Commit b1afe82

Browse files
author
openset
committed
Update: test
1 parent 57bcc39 commit b1afe82

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package convert_sorted_array_to_binary_search_tree
22

3-
import . "github.com/openset/leetcode/internal/kit"
3+
import "github.com/openset/leetcode/internal/kit"
4+
5+
type TreeNode = kit.TreeNode
46

57
/**
68
* Definition for a binary tree node.

problems/convert-sorted-array-to-binary-search-tree/convert_sorted_array_to_binary_search_tree_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"reflect"
55
"testing"
66

7-
. "github.com/openset/leetcode/internal/kit"
7+
"github.com/openset/leetcode/internal/kit"
88
)
99

1010
type caseType struct {
@@ -16,11 +16,11 @@ func TestSortedArrayToBST(t *testing.T) {
1616
tests := [...]caseType{
1717
{
1818
input: []int{-10, -3, 0, 5, 9},
19-
expected: []int{0, -3, 9, -10, 5},
19+
expected: []int{0, -3, 9, -10, kit.NULL, 5},
2020
},
2121
}
2222
for _, tc := range tests {
23-
output := TreeNode2SliceInt(sortedArrayToBST(tc.input))
23+
output := kit.TreeNode2SliceInt(sortedArrayToBST(tc.input))
2424
if !reflect.DeepEqual(output, tc.expected) {
2525
t.Fatalf("input: %v, output: %v, expected: %v", tc.input, output, tc.expected)
2626
}

0 commit comments

Comments
 (0)