⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 balanceddemo.java

📁 这是数据结构中的描述二叉树的一个JAVA 程序。
💻 JAVA
字号:
//实例化排序二叉树
package com.fluently.DataStructure.Applications;

import com.fluently.DataStructure.*;
public class  BalancedDemo 
{
	public static void main(String[] args) 
	{
		//建立一个二叉树
		 BalancedTree theBaTree =new  BalancedTree();
		//插入结点,第一个接点是根接点
	
		theBaTree.insert(23);
		
		theBaTree.insert(11);
		
		theBaTree.insert(6);
		
		theBaTree.insert(50);
	
		theBaTree.insert(29);
	
		theBaTree.insert(100);
		
		theBaTree.insert(60);
		
		theBaTree.insert(90);
		
		
		// 中序编历二叉树

		System.out.println("");
		System.out.println("中序编历如下:");
                                theBaTree.inOrder(theBaTree.root);
		//前序编历二叉树

		System.out.println("");
		System.out.println("前序遍历如下:");
		theBaTree.proOrder(theBaTree.root);
                                //后序遍历二叉树

		System.out.println("");
		System.out.println("后序遍历如下:");
		theBaTree.postOrder(theBaTree.root);

		
			
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -