Solution :

Main.java : Filling the binary tree to test…

package com.adaming;

public class Main {

	public static void main(String[] args) {
		
		Node n1 = new Node(6);
		Node n2 = new Node(2);
		Node n3 = new Node(5, n1, n2);
		
		Node n4 = new Node(8);
		Node n5 = new Node(7, n4, n3);
		
		
		Node n6 = new Node(16);
		Node n7 = new Node(n6, 17);
		
		Node n8 = new Node(13, n7);
		
		Node Arbre = new Node(9, n8, n5);
		
		System.out.println(Arbre.find(7));

		
	}

}

Laisser un commentaire