Top "Set" questions

A set is a collection in which no element is repeated, which may be able to enumerate its elements according to an ordering criterion (an "ordered set") or retain no order (an "unordered set").

How to join two sets in one line without using "|"

Assume that S and T are assigned sets. Without using the join operator |, how can I find the union of …

python set
How to set a Javascript object values dynamically?

It's difficult to explain the case by words, let me give an example: var myObj = { 'name': 'Umut', 'age' : 34 }; var prop = …

javascript object properties set
How do I iterate and modify Java Sets?

Let's say I have a Set of Integers, and I want to increment every Integer in the Set. How would …

java set
How to sort a HashSet?

For lists, we use the Collections.sort(List) method. What if we want to sort a HashSet?

java sorting collections set hashset
Get unique values from arraylist in java

I have an ArrayList with a number of records and one column contains gas names as CO2 CH4 SO2 etc.…

java list set
How to JSON serialize sets?

I have a Python set that contains objects with __hash__ and __eq__ methods in order to make certain no duplicates …

python json serialization set
Empty set literal?

[] = empty list () = empty tuple {} = empty dict Is there a similar notation for an empty set? Or do I have to …

python set literals
Most concise way to convert a Set<T> to a List<T>

For example, I am currently doing this: Set<String> setOfTopicAuthors = .... List<String> list = Arrays.asList( setOfTopicAuthors.…

java list collections set jdk1.6
How to iterate std::set?

I have this code: std::set<unsigned long>::iterator it; for (it = SERVER_IPS.begin(); it != SERVER_IPS.…

c++ set iteration
How to calculate the intersection of two sets?

Possible Duplicate: Efficiently finding the intersection of a variable number of sets of strings Say, have two Hashset, how to …

java set intersection hashset