I've just came over this article, that suggest various techniques with generics.
Author decided to use following:
public class BinarySearchTree<T extends Comparable<? super T>> {
And I don't get it. Why did author decide to use private Entry<T> root;
and not just private Comparable root
?
What particular advantage can generic tree node bring over implemented Comparable interface? Do I need to know more than compare 2 elements in such structures like Binary Search Tree, AVL Tree, Splay Tree, Red-Black Tree and so?