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.
23 lines
667 B
23 lines
667 B
// +build ignore |
|
|
|
package solutions |
|
|
|
import ( |
|
student "../student" |
|
"testing" |
|
) |
|
|
|
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) |
|
} |
|
}
|
|
|