Vector search/ sort help

Jun 2, 2016 at 1:16am
I have been trying to write this for a few days now
I do not know how could someone please just write the code for me

Write a predicate function
bool same_set(vector<int> a, vector<int> b)
that checks whether two vectors have the same elements in some order, ignoring
multiplicities. For example, the two vectors

1 4 9 16 9 7 4 9 11
11 11 7 9 16 4 1
Jun 2, 2016 at 2:15am
1. Implement bool contains(vector<int> v, int i), which returns true if the vector contains the integer.
2. Implement bool subset_of(vector<int> a, vector<int> b), returns true if a is a subset of b. Hint: S1 is a subset of S2 if S2 contains every element of S1.
3. Implement same_set(). Hint: Two sets are the same if each is a subset of the other.
Last edited on Jun 2, 2016 at 2:15am
Topic archived. No new replies allowed.