Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #366 Test for set equality

Set b to true if the sets s and t have the same elements, false otherwise.

import "maps"
b := maps.Equal(s, t)
import java.util.Set;
boolean b = s.equals(t);
b := s = t;
b = s == t
b = s == t

New implementation...
< >
programming-idioms.org