11. Set Operations Flashcards

1
Q

What does the Distinct extension method do?

A

It returns only the distinct (unique) elements from a sequence.

eg. seq.Distinct();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the Intersect extension method do?

A

It allows us to find items that occur in the both of two given sequences.

eg. seqA.Intersect(seqB);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the Union extension method do?

A

It merges two given sequences and removes all duplicate values from the.

eg. seqA.Union(seqB);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the Except extension method do?

A

From two given sequences, it returns the elements of the first sequence that don’t appear in the second sequence.

eg. seqA.Except(seqB);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you find the duplicate values in a given sequence?

A

Group the data by the duplicate property/value you’re looking for, and then filter by using the Count method of the groupings to return all groups with the count of 2 or more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly