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 do I add two sets?

a = {'a', 'b', 'c'} b = {'d', 'e', 'f'} I want to add above two set values. I need output like …

python set
pyspark collect_set or collect_list with groupby

How can I use collect_set or collect_list on a dataframe after groupby. for example: df.groupby('key').collect_…

list group-by set pyspark collect
Time complexity of python set operations?

What is the the time complexity of each of python's set operations in Big O notation? I am using Python's …

python data-structures set complexity-theory big-o
random.choice from set? python

I'm working on an AI portion of a guessing game. I want the AI to select a random letter from …

python list set
add vs update in set operations in python

What is the difference between add and update operations in python if i just want to add a single value …

python set
Obtaining a powerset of a set in Java

The powerset of {1, 2, 3} is: {{}, {2}, {3}, {2, 3}, {1, 2}, {1, 3}, {1, 2, 3}, {1}} Let's say I have a Set in Java: Set<Integer> mySet = new HashSet<…

java algorithm set powerset
Is it possible to use getters/setters in interface definition?

At the moment, TypeScript does not allow use get/set methods(accessors) in interfaces. For example: interface I { get name():…

interface get set accessor typescript
how to use cookie-free domains (yslow)

I was trying to solve the problem with cookie-free, the yslow has suggested to create a subdomain. I did, but …

set subdomain yslow
Python remove set from set

According to my interpretation of Python 2.7.2 documentation for Built-In Types 5.7 Set Types, it should be possible to remove the elements …

python set
Cannot instantiate the type Set

I am trying to create a Set of Strings which is filled with the keys from a Hashtable so a …

java set hashtable