Skip to main content
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
0 answers
64 views

Jackson (de)serialization with redisTemplate

A user has roles, and the serialized version that is stored in Redis is: "{\"@class\":\"package.User\",\"id\":null,\"email\":\"[email protected]\&...
Roger Satsi Dankudi's user avatar
2 votes
2 answers
93 views

Creating an iterator over the `OccupiedEntry`s of a `HashSet` in Rust

Edit I'm realizing that since Entrys own mutable borrows on their parent HashSets, it is impossible for multiple Entrys in a single HashSet to exist simultaneously. Therefore, Entrys will probably not ...
Kaya Arro's user avatar
  • 123
0 votes
2 answers
74 views

what is the maximum length possible of a hashset in python?

m = set() for i in range(10**7): m.add(i) print(999999 in m) above code runs fast (excluding the for loop inserting elements to hash set which takes a while) what is the maximum length ...
Ng Lam's user avatar
  • 9
0 votes
1 answer
65 views

How to create a set order for a HashSet (Java 24, IntelliJ Community) [duplicate]

I have been working on a simple clicker game, and I am using HashSet to store the list of achievements, and they aren't showing up in order. I understand that HashSet does not work like this, but ...
user27209652's user avatar
0 votes
0 answers
39 views

`HashSet` does not respect custom `Hash` implementation? [duplicate]

I’m trying to implement a "Storage" kind of structure: We have items in specific amounts but that amount may be composed of smaller "pile" of different units (they can also differ ...
Abun's user avatar
  • 101
0 votes
1 answer
222 views

Maximize efficiency for this LeetCode style problem [duplicate]

I found this LeetCode style problem in a previous assignment for my university. Assume you have an online clothing store and you have products which come in variable sizes. Some products come in the ...
user29783602's user avatar
-1 votes
1 answer
83 views

How many pointers does java LinkedHashMap/Set Entry object have

In Java HashSet, when a collision occurs, the HashMap stores multiple entries in the same bucket using a linked list. Then in the case of LinkedHashSet, LinkedHashMap will have a pointer to the next ...
Krishna Upadhyay's user avatar
0 votes
0 answers
16 views

How can I insert hashmap values only into Treeset or HashSet

This is my main class: public class Main { public static void main(String[] args) throws BookNotFoundException { // TODO Auto-generated method stub //Library library = new Library(); ...
Elakkiya's user avatar
0 votes
1 answer
164 views

How can the accuracy of a Bloom filter be improved by introducing other data structures?

Suppose I have a very large dataset (for example, 1 billion keys), and I want to determine if a particular key is in this dataset. In this case, a Bloom filter is a good choice (with a time complexity ...
Kato Megumi's user avatar
0 votes
1 answer
88 views

Is RefCell::as_ptr guaranteed to stay the same for a given RefCell?

I am looking for a way to impl Hash for MyStruct where MyStruct contains `Rc<RefCell> (yes, it's a linked list of a sort). This answer suggests std::ptr::hash(self.next.as_ref()), but I have ...
De Cay's user avatar
  • 3
0 votes
0 answers
78 views

how to solve borrowing problem for HashSet

I'm making a tokenizer and have encountered some difficulties. To better understand the problem, I’ll briefly describe the components of the tokenizer: Token. There are 3 types - Constant (fixed, ...
Daniel Fillirini's user avatar
0 votes
1 answer
91 views

A hash function that maintains mathematical equality (especially for sets)

I'm working on a little math-based programming language (written in Rust) that uses sets instead of types. In it, a variable or value belongs to a set of values (eg. x : {1, 2, 3} or msg : Str). The ...
Apuji's user avatar
  • 5
0 votes
1 answer
259 views

Does EFCore Where( ... set.Contains(...)) care whether Set is List or HashSet?

Suppose I an using EFCore to query a SQL DB, and I write: myTableDbSet.Where(entity => filterSet.Contains(entity.Id)) Then does it make any difference (e.g. to performance) what the concrete type ...
Brondahl's user avatar
  • 8,733
0 votes
2 answers
111 views

What is the time complexity of populating a HashSet with n elements?

I was working on the Leetcode problem "Reverse Vowels of a String." Here is my first solution: class Solution { public String reverseVowels(String s) { String vowels = "...
Tea17_Xi's user avatar
1 vote
1 answer
101 views

Obtaining a Vec<X> from a &HashSet<X> [closed]

Assume I have some function do_stuff that takes a &HashSet<X> and wants to collect the items into a Vec<X> by copying all the elements. What is the canonical way to do that? I have ...
Smiley1000's user avatar

15 30 50 per page
1
2 3 4 5
154
Morty Proxy This is a proxified and sanitized view of the page, visit original site.