treeset
Generics and TreeSets
Working with Generics is definitely my weak spot, and can use some help with this. The project is to develop a simple order/inventory system that places orders, keeps track of items and inventories,[详细]
2023-02-07 19:02 分类:问答Sorted sets and comparators
I\'m working with a TreeSetthat is meant to store pathfind locations used during the execution of a A* algorithm.[详细]
2023-02-03 08:00 分类:问答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) {[详细]
2023-01-30 11:17 分类:问答Why can we supply a Comparator to TreeSet but not something like Hasher to HashSet?
In Java 6, my understanding is that you can supply a Comparator to a TreeSet when creating it to override the \"natural ordering\" of the objects in the set.[详细]
2023-01-30 07:01 分类:问答Java TreeSet contains() gives false results
I am trying to code a little bit of math with java. What I am trying to do, is to put cyclotomic cosets to the TreeSet. A coset has an index and a set of integer numbers. A coset is equal to other cos[详细]
2023-01-27 08:42 分类:问答Trimming a sorted set
I have a SortedSet (specifically a TreeSet) containing updates. An update is something like an SVN commit, Facebook wall post, new Trac ticket, etc. I\'m storing these in a SortedSet because:[详细]
2023-01-27 02:24 分类:问答Ranking elements in TreeSet
I know a java treeset can\'t have identical elements and so I have to somehow differentiate an element from another even if they have the same \"value\". I want to be able to rank the elements and I\'[详细]
2023-01-26 16:50 分类:问答How to find the rank of an element in a TreeSet
I know you can find the first and last elements in a treeset.What if I wanted to know what the second or third element was without iterating?Or, more preferable, given an element, figure out it\'s ran[详细]
2023-01-23 15:30 分类:问答Java Point2D and Comparable
I\'m making a TreeSet of Point2D.Float type, creating it with a custom Comparable class that implements compare() of Point2D type. However, on calling \"contains\" on the TreeSet, I get a classcast er[详细]
2023-01-15 13:40 分类:问答At what level is a given element in a Java TreeSet?
Does anybody 开发者_Go百科know a fast way to detect at what level a given element is in a TreeSet? By level, I mean the depth of this element in the tree, i.e. the number of its ancestors.[详细]
2023-01-14 01:27 分类:问答