Java Applets Centre
Binary Search Tree (Search)

This applet demonstrates the search operation on a binary search tree.

Code (Tree Node)

public class tNode{
 int data;
 tNode left;
 tNode right;

Code (BST Search)

boolean search(int val){
 tNode n=root;
   if(val < n=n.left;
   else n=n.right;
   if(n==null) return false;
 return true;

Data Structures and Algorithms
Java Applets Centre

R. Mukundan
Department of Computer Science
University of Canterbury
Private Bag 4800, Christchurch
New Zealand.