MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / Test_invertTree

Function Test_invertTree

invert_binary_tree_226/solution_test.go:9–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func Test_invertTree(t *testing.T) {
10 type args struct {
11 root *TreeNode
12 }
13 tests := []struct {
14 name string
15 args args
16 want *TreeNode
17 }{
18 {
19 name: "invert binary tree",
20 args: args{
21 root: &TreeNode{
22 Val: 4,
23 Left: &TreeNode{
24 Val: 2,
25 Left: &TreeNode{
26 Val: 1,
27 },
28 Right: &TreeNode{
29 Val: 3,
30 },
31 },
32 Right: &TreeNode{
33 Val: 7,
34 Left: &TreeNode{
35 Val: 6,
36 },
37 Right: &TreeNode{
38 Val: 9,
39 },
40 },
41 },
42 },
43 want: &TreeNode{
44 Val: 4,
45 Left: &TreeNode{
46 Val: 7,
47 Left: &TreeNode{
48 Val: 9,
49 },
50 Right: &TreeNode{
51 Val: 6,
52 },
53 },
54 Right: &TreeNode{
55 Val: 2,
56 Left: &TreeNode{
57 Val: 3,
58 },
59 Right: &TreeNode{
60 Val: 1,
61 },
62 },
63 },
64 },
65 {
66 name: "invert binary tree",

Callers

nothing calls this directly

Calls 1

invertTreeFunction · 0.85

Tested by

no test coverage detected