3、ivateNodeleft;privateNoderight;privateintvalue;//privateintnum;publicNode(intvalue){this.value=value;}publicvoidadd(intvalue){if(value>this.value){if(right!=null)right.add(value);else{Nodenode=newNode(value);right=node;}}else{if(left!=null)left.add(value);else{Nodenode=newNode(value);left=node;
4、}}}publicbooleanfind(intvalue){if(value==this.value)returntrue;elseif(value>this.value){if(right==null)returnfalse;elsereturnright.find(value);}else{if(left==null)returnfalse;elsereturnleft.find(value);}}publicvoiddisplay(){System.out.println(value);if(left!=null)left.display();if(right!=null)r
5、ight.display();}/*publicIteratoriterator(){}*/publicstaticvoidmain(String[]args){int[]values=newint[8];for(inti=0;i<8;i++){intnum=(int)(Math.random()*15);//System.out.println(num);//if(Arrays.binarySearch(values,num)<0)if(!contains(values,num))values[i]=num;elsei--;}System.out.println(Arrays.to
6、String(values));Noderoot=newNode(values[0]);for(inti=1;i7、??????Ё??????????????????Ё???????????????????Ё????????????????????????????????????????????????????????????????????????????????????????????1,??,282,??,353,??,284,??,355,??,286,??,357,??,288,??,35???????ㄨ乬???????????????????????????