阅读背景:

Java-如何比较泛型类型?

来源:互联网 

Here's the code for a generic binary search tree. Now, it runs and compiles perfectly, but with one problem that I only noticed now, after I have finished this class. The problem is that the insert method uses compareTo()(when it comes to comparing the nodes' elements) to decide where to place the next node in the tree according to its' value. And for instance for an input of:Here's the code for a generic binary search tre




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: