Binary Tree

can any one of you provide me with java code to build a binary search tree defing and implementing the functions insert and delete
[137 byte] By [bahar_1a] at [2007-11-27 1:49:04]
# 1
http://en.wikipedia.org/wiki/Binary_search_tree
DrLaszloJamfa at 2007-7-12 1:13:54 > top of Java-index,Java Essentials,New To Java...
# 2
I need a written code to run it and see how it behave.
bahar_1a at 2007-7-12 1:13:54 > top of Java-index,Java Essentials,New To Java...
# 3
I'm pretty sure you can find out how a binary tree behaves from the link above.Google is your friend. Also, are you studying this out of your own free will?
lethalwirea at 2007-7-12 1:13:54 > top of Java-index,Java Essentials,New To Java...
# 4
> Also, are you studying this out of your own free will?Sounds like the OP is only willin to code under duress.
DrLaszloJamfa at 2007-7-12 1:13:54 > top of Java-index,Java Essentials,New To Java...
# 5
lol yeh, the OP sounds just like an assignment, don't write any code for this fella unless he's willing do something himself :)
Simeona at 2007-7-12 1:13:54 > top of Java-index,Java Essentials,New To Java...
# 6

TreeSet <T> binarySearchTree = new TreeSet<T>();

public void insert(T obj)

{

binarySearchTree.add(obj);

}

public void delete(T obj)

{

binarySearchTree.remove(obj);

}

; - )

shlumpha at 2007-7-12 1:13:54 > top of Java-index,Java Essentials,New To Java...