Solution Found!
Write a functionbool same_set(int a[], int a_size, int b[], int b_size)that checks
Chapter 6, Problem P6.10(choose chapter or problem)
Write a functionbool same_set(int a[], int a_size, int b[], int b_size)that checks whether two vectors have the same elements in some order, ignoringduplicates. For example, the two arrays1 4 9 16 9 7 4 9 11and11 11 7 9 16 4 1would be considered identical. You will probably need one or more helperfunctions.
Questions & Answers
QUESTION:
Write a functionbool same_set(int a[], int a_size, int b[], int b_size)that checks whether two vectors have the same elements in some order, ignoringduplicates. For example, the two arrays1 4 9 16 9 7 4 9 11and11 11 7 9 16 4 1would be considered identical. You will probably need one or more helperfunctions.
ANSWER:Step 1 of 2
The program requires to check if the given two arrays has the same elements in some order, ignoring duplicates. For this, first take one array. For each element of this array, check whether the second array contains that element too. If no, then the arrays are not considered identical and the function returns false value. Perform similar operation taking for the second array too.