Questions tagged [sortedset]

Represents a collection of unique objects that is maintained in sorted order.

Starting with the .NET Framework 4, the SortedSet<T> class provides a self-balancing tree that maintains data in sorted order after insertions, deletions, and searches.

More info at MSDN.

284 questions
0
votes
3 answers

SortedHashTable in c#

What I am trying to do is to implement a heuristic approach to NP complete problem: I have a list of objects (matches) each has a double score. I am taking the first element in the list sorted by the score desc and then remove it from the list. Then…
BanditoBunny
  • 3,086
  • 5
  • 26
  • 39
0
votes
1 answer

Java Sorted Set of Maps converted to an array

I have these two data structures: public TreeMap tableFrequency; public SortedSet> sortedTable; sortedTable holds the same information as tableFrequency but it is sorted descendingly by…
CodeKingPlusPlus
  • 12,865
  • 46
  • 123
  • 204
-1
votes
1 answer

zrevrange with order of members with same score not reversed

zrange sortedSetKey 0 -1 rev This returns the members in the reverse order. Now, if there is more than one member with the same score. It returns the members in the reversed order (ordering of same score members is lexicographical) Question: How do…
Anoosh
  • 55
  • 8
-1
votes
1 answer

ZRANGESTORE prior Redis 6.2.0

Basically I would like to store the top 5 from a sorted set in different set. In redis 6.2 I can do it with ZRANGESTORE with REV option. What is the alternative in lower versions?
Nir
  • 2,017
  • 8
  • 35
  • 54
-1
votes
1 answer

New comparator for set in C++

Is there a way to create a set with a new default custom comparator, and then every item that gets inserted in the set would be inserted based on the new comparator?
teo.argi
  • 13
  • 5
-1
votes
2 answers

Losing data when transferring data from TreeMap to TreeSet.

I have a TreeMap like so. // Create a map of word and their counts. // Put them in TreeMap so that they are naturally sorted by the words Map wordCount = new TreeMap(); wordCount.put("but",…
kaun jovi
  • 415
  • 1
  • 4
  • 17
-1
votes
1 answer

Redis sorted sets

I have a list of Ids from a table that I want to store in a Redis sorted set. Each of these ids has a date and entity associated with it. The plan is to use the id as the score and allow Redis to sort them accordingly. When it is time for lookup I…
-1
votes
1 answer

redis zrank : Floating-Point Numbers May Lose Precision

When I push score value length longer than 16 . like 10000000000000000.. Then rank of sortedset get wrong . How make it support 48 ? or make it support string rank somehow ?
xjk
  • 63
  • 5
-1
votes
2 answers

How to subSet from SortedSet

I have to write a code that makes it possible to delete all the words of a SortedSet starts with K. import java.util.*; public class Deleter { public static void deleteKWords(SortedSet set) { set.subSet("K", ""); } } …
merdle
  • 264
  • 2
  • 20
-1
votes
1 answer

hibernate sorted map mapping? ERROR: HHH000091

Hello all I'm new to Hibernate, and so I'm following some tutorials in the internet. But this example gives me the following error. Any ideas ?? update 1 - I tried to fix the bug so many times, but still couldn't do it. When debugging I found that…
B378
  • 762
  • 1
  • 10
  • 23
-1
votes
4 answers

TreeMap used in SortedSet

Why can’t we use other classes like HashSet,HashMap or other classes in place of TreeMap/TreeSet in SortedSet interface? import java.util.HashSet; import java.util.Iterator; import java.util.SortedSet; import java.util.TreeSet; public class…
Ranju
  • 9
  • 2
-2
votes
1 answer

SortedSet in Grails doesn't work

I want to use a SortedSet with Grails, but all I get is a MissingMethodException. The class that contains the sorted set looks like this: class SystemUser { SortedSet organisations // ... some other fields static hasMany =…
deamon
  • 78,414
  • 98
  • 279
  • 415
-2
votes
2 answers

Ordered Set based on linked list

I am working with java, and I need to implement an ordered set, base on a linked list using the interface SortedSet. How do I implement the methods from SortedSet by this conditions?
Leon
  • 13
  • 5
-3
votes
1 answer

ZREMRANGEBYRANK difference between ZREMRANGEBYSCORE

What's the difference between ZREMRANGEBYRANK and ZREMRANGEBYSCORE ? Explain it me regarding to following query: 127.0.0.1:6379> ZRANGEBYSCORE my 1 10 WITHSCORES 1) "b" 2) "1" 3) "a" 4) "4"
1 2 3
18
19