I've always loved trees, that nice O(n*log(n))
and the tidiness of them. However, every software engineer I've ever known has asked me pointedly why I would use a TreeSet
. From a CS background, I don't think it matters all that much which you use, and I don't care to mess around with hash functions and buckets (in the case of Java
).
In which cases should I use a HashSet
over a TreeSet
?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…