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 does a Python set([]) check if two objects are equal? What methods does an object need to define to customise this?

I need to create a 'container' object or class in Python, which keeps a record of other objects which I …

python methods comparison set
How can I convert a Set to an Array in TypeScript

How can I convert a Set (eg, {2,4,6}) to an Array [2, 4, 6] in TypeScript without writing a loop explicitly ? I have tried …

arrays typescript set typescript1.8
Java: Enumeration from Set<String>

I have a simple collections question. I have a Set<String> object. I want an Enumeration<String&…

java collections set enumeration
Creating 2D dictionary in Python

I have a list of details from an output for "set1" which are like "name", "place", "animal", "thing" and a "…

python dictionary set key 2d
append set to another set

Is there a better way of appending a set to another set than iterating through each element ? i have : set&…

c++ insert set
Find all subsets of length k in an array

Given a set {1,2,3,4,5...n} of n elements, we need to find all subsets of length k . For example, if n = 4 …

arrays algorithm set permutation
Remove Element from Set

I'm trying to remove all Strings that are of even length in a set. Here is my code so far, …

java string foreach set string-length
What's the Big-O of a stack, queue, set, and deque?

What is the Big-O efficiency of a stack, queue, set, and deque as it pertains to insertion, search, indexing, space, …

stack set queue big-o deque
Doctrine 2 OneToMany Cascade SET NULL

The error Cannot delete or update a parent row: a foreign key constraint fails. The classes class Teacher { /** *@ORM\OneToMany(…

doctrine null set one-to-many
Does Java's LinkedHashMap maintain the order of keys?

When LinkedHashMap.keySet() is called, will the order of the Set returned be the same as the order the keys …

java map set linkedhashmap