title: How to return the k-th element in TreeSet in Java?
body: <p>Maybe I am not using the right data structure. I need to use a set, but also want to efficiently return the k-th smallest element. Can <code>TreeSet</code> in Java do this? There seems no built-in method of <code>TreeSet</code> to do this.</p>