为什么不实际在其中存放很长时间:
public class Tree implements Comparable<Tree> { public long dist; //value is actually Long public int compareTo(Tree o) { return this.dist<o.dist?-1: this.dist>o.dist?1:0; }}或先比较字符串的长度,然后再比较它们
public String dist; //value is actually Longpublic int compareTo(Tree o) { if(this.dist.length()!=o.dist.length()) return this.dist.length()<o.dist.length()?-1:1;//assume the shorter string is a smaller value else return this.dist.compareTo(o.dist);}


