Top "Treeset" questions

a Java set implementation sorting its items upon insertion; provided by JRE/JDK.

Hashset vs Treeset

I've always loved trees, that nice O(n*log(n)) and the tidiness of them. However, every software engineer I've …

java hashset treeset
Treeset to order elements in descending order

Here is the piece of code that I have used for Java 5.0 TreeSet<Integer> treeSetObj = new TreeSet<…

java core collections treeset
Using iterator on a TreeSet

SITUATION: I have a TreeSet of custom Objects and I have also used a custom Comparator. I have created an …

java collections iterator concurrentmodification treeset
How come Java's TreeSet has no get() method?

What if I want to retrieve and update objects that stored in a TreeSet? The reason I'm asking, is that …

java collections treeset
TreeSet constructor with Comparator<?> parameter

In Java’s documentation for its class TreeSet one of the constructors is shown to have the following header: TreeSet(…

java generics comparator treeset
In TreeSet, Sorting & Uniqueness of custom objects based on different properties

Below is my Student class class Student implements Comparable { String name; int rollNo; @Override public int compareTo(Object obj) { return ((…

java sorting collections treeset unique
How to find the index of an element in a TreeSet?

I'm using a TreeSet<Integer> and I'd quite simply like to find the index of a number in …

java algorithm data-structures treeset sortedset
How to return the k-th element in TreeSet in Java?

Maybe I am not using the right data structure. I need to use a set, but also want to efficiently …

java algorithm data-structures selection treeset
Converting a TreeSet to ArrayList?

I have a TreeSet which contains > 100k objects. I have another method which requires ArrayList as an param. Is …

java arraylist treeset
java: TreeSet order

With this code I get this output: TreeSet<String> t=new TreeSet<String>(); t.add("test 15"); …

java treeset