mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
668 B
24 lines
668 B
// +build ignore |
|
|
|
package solutions |
|
|
|
import ( |
|
"testing" |
|
|
|
student "../student" |
|
) |
|
|
|
func CompareTrees(root *solutions.TreeNode, rootS *student.TreeNode, t *testing.T) { |
|
if root != nil && rootS != nil { |
|
CompareTrees(root.Left, rootS.Left, t) |
|
CompareTrees(root.Right, rootS.Right, t) |
|
if root.Data != rootS.Data { |
|
t.Fatalf("BTreeInsertData(%v), node == %v instead of %v ", |
|
root.Data, root.Data, rootS.Data) |
|
} |
|
} else if root != nil && rootS == nil { |
|
t.Fatalf("BTreeInsertData(%v), node == %v instead of %v ", root, root, rootS) |
|
} else if root == nil && rootS != nil { |
|
t.Fatalf("BTreeInsertData(%v), node == %v instead of %v ", root, root, rootS) |
|
} |
|
}
|
|
|