Это довольно простой метод равных.
Вот что у меня в коде:
public boolean equals(Object other)
if (other == null) {
return false;
}
if (!(other instanceof BinaryTree)) {
return false;
}
return this.equalsUtil(this.root, other.root);
}
Вот начальная проблема
public class BinaryTree {
protected class Node {
//instancee variables and a constructor
}
protected Node root;
//remainder ommited for brevity
Я могу 't call other.root
(Object other
- параметр для равных), как я могу это сделать тогда?
Обратите внимание, что мой класс public class MyBinaryTree extends Bina