2013-04-10 23:57:08 -07:00
|
|
|
public class Tree<T>{
|
|
|
|
|
private T value;
|
|
|
|
|
private Tree<T> left;
|
|
|
|
|
private Tree<T> right;
|
|
|
|
|
|
|
|
|
|
public void replaceAll(T value){
|
|
|
|
|
this.value = value;
|
2019-09-12 10:33:56 -07:00
|
|
|
if (left != null)
|
2013-04-10 23:57:08 -07:00
|
|
|
left.replaceAll(value);
|
2019-09-12 10:33:56 -07:00
|
|
|
if (right != null)
|
2013-04-10 23:57:08 -07:00
|
|
|
right.replaceAll(value);
|
|
|
|
|
}
|
|
|
|
|
}
|