Anarkie
Anarkie

Reputation: 695

Difference between BST and Randomized BST

I have the source code of BST(Binary Search Tree) and Randomized BST from our professors lecture slides, now I want to test if they are working, by inserting new elements, and then how can I see my results like on http://cs.lmu.edu/~ray/images/bstexample.png I would like to print them on console and possibly with some spaces ie:

 5
3 7
   9

What would be a way to get a node, an inserted element of the BST object and print on console?How can I do this, and what is the difference between BST and RBST, also on this line:

public class BST <Key extends Comparable ,Val> extends AbstractST <Key ,Val> implements Iterable <Key>

what are the <> for, are the they same like parentheses , I would be glad if you can explain me the code line above.Thanks for your time!

Upvotes: 0

Views: 155

Answers (1)

D.Shawley
D.Shawley

Reputation: 59583

The <X> designates a Generic Type depending on X. See the Java Tutorial on Generics for more details.

Upvotes: 1

Related Questions