To check if a set B is a subset of A or not. Which data structure to be used to store set A for quicker response(linked list/hash map)? What if I want to check intersection also?
It is enough to sort the both sets and to use standard algorithm std::includes or set_intersection.
Last edited on