Omgili - forum search, search forums  
  

Discussions about hashset

Displaying 1 - 10 out of 1,060 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
Hi, I have a pretty big (100'000s of entries) HashMap . Now, I need a HashSet containing all the keys from this HashMap . Unfortunately, HashMap only has a keySet() method which returns a Set but not a HashSet . What would be an efficient way to generate...
Started by on , 6 posts by 6 people.  
Can you not create the HashSet from an existing Set ? But (more importantly) why are you worried about the implementation returned to you from the keySet() method....
HashSet myHashSet = new HashSet(myHashMap.keySet()); Haven't tried it.
I have a hashset in C# that Iam removing from if a condition is met while iterating though the hashset and cannot do this using a froeach loop as below. foreach (String hashVal in hashset) { if (hashVal == "somestring") { hash.Remove("somestring"); } ...
Started by on , 4 posts by 4 people.  
This avoids the problem of modifying the hashset whilst....
Any item in the hashset that matches the predicate will be removed.
If(ShouldRemove(index)) Then Remove(index) Use the RemoveWhere method of HashSet instead to the method.
How do I convert a HashSet<T> to an array in .NET?
Started by on , 4 posts by 4 people.  
Int[] entries = hs.ToArray....
HashSet<int> hs = ...
Using System.Linq; ...
As well use it : T[] myArray = System.Linq.Enumerable.ToArray(hashSet); If you mean mean you're on 3.5, just use ToArray since HashSet implements IEnumerable, e.g.
Ask your Facebook Friends
What is the equivalent Scala constructor (to create an immutable HashSet ) to the Java: new HashSet<T>(c) where c is of type Collection<? extends T> . All I can find in the HashSet Object is apply
Started by on , 3 posts by 3 people.  
Scala.collection.immutable.HashSet val list = List(1,2,3) val set = HashSet() ++ list.
I really want to use hashsets in my program. Using a dictionary feels ugly. I'll probably start using VS2008 with .Net 3.5 some day, so my ideal would be that even though I can't (or can I?) use hashsets in VS2005, when I start using .NET 3.5, I don't...
Started by on , 7 posts by 7 people.  
You could use Iesi.Collections (used by NHibernate) or Mono's HashSet The C5 Library also has a ....
Not really the same thing, but it might simplify things and I'm very pleased with it .
The Dictionary as Hashset with a using directive.
I need a HashSet that preserves insertion ordering, are there any implementations of this in the framework?
Started by on , 5 posts by 5 people.  
For sequences that need to persist order, look at List< .
That defeats the purpose of a HashSet.
I am wondering since the HashSet is implemented via a HashMap instance , what would be the key that would be used to put data into HashSet. i gone through the link http://www.coderanch.com/t/251832/Programmer-Certification-SCJP/certification/Difference...
Started by on , 4 posts by 4 people.  
That way the add , remove.
The key would be the object that went into the hashset itself since keys of maps are sets is to use the object you add to the HashSet as a key of the HashMap .
According to the HashSet javadoc, HashSet.contains only returns a boolean. How can I "find" an object in a hashSet and modify it (it's not a primitive data type)? I see that HashTable has a get() method, but I would prefer to use the set.
Started by on , 6 posts by 6 people.  
Like: MyObject obj = new MyObject(); HashSet hashSet = new HashSet(); hashSet.add(obj.
I am exploring the HashSet<T> type, but I don't understand where it stands in collections. Can one use it to replace a List<T> ? I imagine the performance of a HashSet<T> to be better, but I couldn't see individual access to its elements...
Started by on , 10 posts by 10 people.  
Instead, what better captures your intent....
Performance would be a bad reason to choose HashSet over List.
A set is a collection of values containing no duplicate is the answer you were looking for .
HashSet is a set implemented by hashing.
Currently the HashSet<T> constructor that allows you to define your equality comparison yourself is the HashSet<T>(IEqualityComparer<T> comparer) constructor. I would like to define this EqualityComparer as a lambda. I found this blog...
Started by on , 3 posts by 3 people.  
Class HashSet { public static HashSet<T> Create<T>(Func<T, T, int> func.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost