public class Node<E> { int x; Node l, r; public Node() {} public Node(int x){ this.x = x; } public boolean search(int x){//Поиск элемента, если есть возвращает true if(this.x == x) return true; else if(this.x > x && l != null) return l.search(x); //Если x > or < значения в узле и если узел не пуст else if(this.x < x && r != null) return r.search(x); //Вызываем search от узла else return false; } } How to use generic correctly and how does the search function use the comparator to compare objects of non-primitive types?
