Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c852423

Browse files
Create pseudo-palindromic-paths-in-a-binary-tree_test.go
1 parent 1e261d8 commit c852423

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package pseudo_palindromic_paths_in_a_binary_tree
2+
3+
import "testing"
4+
5+
func Test_pseudoPalindromicPaths(t *testing.T) {
6+
type args struct {
7+
root *TreeNode
8+
}
9+
tests := []struct {
10+
name string
11+
args args
12+
want int
13+
}{
14+
{
15+
name: "test case 1",
16+
args: args{
17+
root: &TreeNode{
18+
Val: 2,
19+
Left: &TreeNode{
20+
Val: 3,
21+
Left: &TreeNode{
22+
Val: 3,
23+
},
24+
Right: &TreeNode{
25+
Val: 1,
26+
},
27+
},
28+
Right: &TreeNode{
29+
Val: 1,
30+
Right: &TreeNode{
31+
Val: 1,
32+
},
33+
},
34+
},
35+
},
36+
want: 2,
37+
},
38+
}
39+
for _, tt := range tests {
40+
t.Run(tt.name, func(t *testing.T) {
41+
if got := pseudoPalindromicPaths(tt.args.root); got != tt.want {
42+
t.Errorf("pseudoPalindromicPaths() = %v, want %v", got, tt.want)
43+
}
44+
})
45+
}
46+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /