java£ºÊÖд¶þ²æÊ÷BinaryTreeÌí¼ÓºÍ²éѯ·½·¨
package arrays.myArray;
public class BinaryTree {
private Node root;
// Ìí¼ÓÊý¾Ý
public void add(int data) {
// µÝ¹éµ÷ÓÃ
if (null == root)
root = new Node(data, null, null);
else
addTree(root, data);
}
private void addTree(Node rootNode, int data) {
// Ìí¼Óµ½×ó±ß
if (rootNode.data > data) {
if (rootNode.left == null)
rootNode.left = new Node(data, null, null);
else
addTree(rootNode.left, data);
} else {
// Ìí¼Óµ½ÓÒ±ß
if (rootNode.right == null)
rootNode.right = new Node(data, null, null);
else
addTree(rootNode.right, data);
}
}
// ²éѯÊý¾Ý
public void show() {
showTree(root);
}
private void showTree(Node node) {
if (node.left != null) {
showTree(node.left);
}
System.out.println(node.data);
if (node.right != null) {
showTree(node.right);
}
}
}
class Node {
int data;
Node left;
Node right;
public Node(int data, Node left, Node right) {
this.data = data;
this.left = left;
this.right = right;
}
}
Ïà¹ØÎĵµ£º
¡¡¡¡1 MySQL´æ´¢´óÈÝÁ¿µÄ¶þ½øÖÆÎļþµÄ¸ñʽÊÇblob£¬Æäʵ³ýÁËͼƬ»¹¿ÉÒÔ´æ±ðµÄ
¡¡¡¡2 ÒªÏòÊý¾Ý¿â´æ´¢¶þ½øÖƵÄÎļþÒ»¶¨Òª°ÑÒª´æ´¢µÄÊý¾Ýת»»³É¶þ½øÖÆÁ÷
¡¡¡¡·Ï»°¾Í²»¶à˵ÁË£¬´ó¼Ò¿´¿´´úÂëºÜÈÝÒ×Ã÷°×£¬ÏÈÀ´¿´Ò»¸öapp³ÌÐò£¬µ±È»Ê×ÏÈÄúÒªÔÚÊý¾Ý¿âÖÐÏȽ¨Á¢Ò»¸öÓÃÓÚ±£´æͼƬµÄ±íºÍÏàÓ¦µÄÁУ¬Êý¾Ý¸ñʽΪblob
¡¡¡¡ package ......
Èí¼þÃû³Æ£ºÍ¼Êé¹ÜÀí¹¤¾ß
×ÜÌåÉè¼Æ£º
1.
ÃüÁîÐвÙ×÷·½Ê½
2.
»¶ÓÒ³Ãæ
---welcome to visit
software of book
management
Now is ...
& ......
1.Welcome.java
import java.util.Date;
import java.util.Scanner;
public class Welcome {
/**
* @param args
* @throws IOException
*/
public static void main(String[] args){
// TODO Auto-generated method stub
System.out.println("Welcome to vis ......
µ±Á½¸ö½ø³ÌÔÚ½øÐÐÔ¶³ÌͨÐÅʱ£¬±Ë´Ë¿ÉÒÔ·¢Ë͸÷ÖÖÀàÐ͵ÄÊý¾Ý¡£ÎÞÂÛÊǺÎÖÖÀàÐ͵ÄÊý¾Ý£¬¶¼»áÒÔ¶þ½øÖÆÐòÁеÄÐÎʽÔÚÍøÂçÉÏ´«ËÍ¡£·¢ËÍ·½ÐèÒª°ÑÕâ¸öJava¶ÔÏóת»»Îª×Ö½ÚÐòÁУ¬²ÅÄÜÔÚÍøÂçÉÏ´«ËÍ£»½ÓÊÕ·½ÔòÐèÒª°Ñ×Ö½ÚÐòÁÐÔÙ»Ö¸´ÎªJava¶ÔÏó¡£
¡¡¡¡°ÑJava¶ÔÏóת»»Îª×Ö½ÚÐòÁеĹý³Ì³ÆΪ¶ÔÏóµÄÐòÁл¯¡£
¡¡¡¡°Ñ×Ö½ÚÐòÁлָ´ÎªJava¶ÔÏóµÄ¹ ......