首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

查询二叉树的兑现

2013-03-21 
查询二叉树的实现package SearchTreepublic class MainClass {/** * @param args */public static void m

查询二叉树的实现

package SearchTree;public class MainClass {/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubTree T =new Tree();int[] a = {4 ,3 ,5,2,6,7,1};for(int i=0;i < a.length; i++){T.Tree_Insert(new Node(null, null, null, a[i]));}T.InOrder_Tree_Walk();System.out.println("The minmum element is :" +T.Tree_Minmum().getData());System.out.println("The Maximum element is :" + T.Tree_Maximum().getData());System.out.println("The element 6's successor is:" + T.Tree_Successor(6).getData());System.out.println("The element 6's predecessor is:" + T.Tree_Predecessor(6).getData());T.Tree_Delete(5);T.InOrder_Tree_Walk();}}


热点排行