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.
|
|
|
// +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.Errorf("BTreeInsertData(%v), node == %v instead of %v ",
|
|
|
|
root.Data, root.Data, rootS.Data)
|
|
|
|
}
|
|
|
|
} else if root != nil && rootS == nil {
|
|
|
|
t.Errorf("BTreeInsertData(%v), node == %v instead of %v ", root, root, rootS)
|
|
|
|
} else if root == nil && rootS != nil {
|
|
|
|
t.Errorf("BTreeInsertData(%v), node == %v instead of %v ", root, root, rootS)
|
|
|
|
}
|
|
|
|
}
|