sortedset Questions
3
Solved
Ok say I have a strongly typed SortedSet of type int. I want to find the largest number in the set that is less than x.
Maybe this is the wrong data structure for this but my intuitive thinking is...
6
Solved
I'm calculating intersection of 2 sets of sorted numbers in a time-critical part of my application. This calculation is the biggest bottleneck of the whole application so I need to speed it up.
I'...
Arenas asked 23/8, 2011 at 16:49
1
Solved
I don't believe that SortedSet.IsSubsetOf is working as expected. Given this code, shouldn't ss.IsSubsetOf(l) return True?
I'm suspicious that the problem is in my CompareTo function, but I can't s...
Therapsid asked 11/5, 2024 at 18:5
7
Solved
Is there a Python design decision (PEP) that precludes a sorted container from being added to Python?
(OrderedDict is not a sorted container since it is ordered by insertion order.)
Knorr asked 10/5, 2011 at 16:24
6
I want to print an ordered list in Map using the following:
Map<Float, String> mylist = new HashMap<>();
mylist.put(10.5, a);
mylist.put(12.3, b);
mylist.put(5.1, c);
SortedSet<Fl...
2
in the Microsoft documentation, the complexity is indicated as O(n)
but if you look at the implementation
foreach (T item in other)
{
if (Contains(item))
{
return true;
}
}
, then the searc...
4
Solved
I am a bit puzzled about the behaviour of SortedSet, see following example:
public class Blah
{
public double Value { get; private set; }
public Blah(double value)
{
Value = value;
}
}
publ...
2
Solved
In .NET 4.0+, a class SortedSet<T> has a method called GetViewBetween(l, r), which returns an interface view on a tree part containing all the values between the two specified. Given that Sor...
Alesandrini asked 24/3, 2012 at 10:29
0
I'm trying to forecast memory usage on my Redis (v6.2.5) cluster when using sorted sets. From my initial research I can tell that the length of the key, the length of each individual element, and t...
5
Solved
I have created a Student class like this:
public class Student implements Comparable<Student> {
private String firstName;
private String lastName;
public Student(String firstName, Strin...
Chaunce asked 10/7, 2015 at 7:14
3
Solved
I am writing a algo for deducing the user with the least amount of work load. Based on the type/complexity of the tasks being created, i narrow down on the list of the users that are capable of per...
4
Solved
I thought that null is allowed for a Set.
So why does the following code:
SortedSet<Integer> set = new TreeSet<Integer>();
set.add(null);
set.add(1); //--->Line indicated by exce...
Antiphrasis asked 23/7, 2012 at 7:45
2
Solved
I'm using Redis sorted set to implement the leaderboard of my game, where I show the user ranking in descending order. I'm stuck in a case where two or more users have the same score. So in this ca...
Metacarpal asked 5/10, 2018 at 6:9
5
Solved
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:
Sort...
Hebbel asked 28/11, 2010 at 13:33
2
Why would I use a redis sorted set of articles sorted by unix timestamp over a redis list and pushing elements onto it. They seem to offer the same end results. One thing I notice is with a redis s...
3
Solved
From SortedSet documentation:
several methods return subsets with restricted ranges. Such ranges
are half-open, that is, they include their low endpoint but not their
high endpoint (where appl...
1
Solved
In my case I upload a lot of records to Redis sorted set, but I need to store only 10 highest scored items. I don't have ability to influence on the data which is uploaded (to sort and to limit it ...
1
Solved
I have a csv parser that reads in 15+ million rows (with many duplicates), and once parsed into structs, need to be added to a collection. Each struct has properties Key (int), A(datetime), and B(i...
2
Solved
The Redis document said as below :
ZSETs are ordered sets using two data structures to hold the same elements
in order to get O(log(N)) INSERT and REMOVE operations into a sorted
data structur...
Koerlin asked 15/7, 2017 at 5:59
2
I have a log data in mysql
id | value | date
1 | 10.2 | 2017-07-20 18:00:00
2 | 10.5 | 2017-07-20 18:00:01
3 | 10.3 | 2017-07-20 18:00:03
then transformed it into hash dan sorted set in redis.
...
3
Google Guava has a SortedSetMultimap. Wonderful. Now where is the immutable version? There exists an ImmutableSetMultimap. But what about ImmutableSortedSetMultimap? (Please don't reply with "Why d...
Browne asked 10/9, 2014 at 22:48
5
A TreeSet puts an element in natural ordering or by the provided
comparator.
A SortedSet is also keeps the element in natural order
But what is the difference between them and NavigableSet?
Wher...
1
Solved
I am currently implementing Dijkstra's algorithm and I am using the C# SortedSet as a priority queue.
However, in order to keep track of what vertices I have already visited, I want to remove the f...
7
Solved
I've got a object that defines a 'natural sort order' using Comparable<>.
These are being stored in TreeSets.
Other than removing and re-adding the object, is there another way to update the so...
Riordan asked 5/4, 2010 at 17:0
4
Solved
What's the best way to get the sum of SCORES in a Redis sorted set?
1 Next >
© 2022 - 2025 — McMap. All rights reserved.