Question: Write a code (in any programming language) that receives two sets A and B and decides whether A B or not: Input: m (a postive
Write a code (in any programming language) that receives two sets A and B and decides whether A B or not: Input: m (a postive integer), n (a positive integer), all,a(2..,. m] (a one dimensional array representing A), b1, bl2]., b[n] (a one dimensional array representing B) ), n (a positive integer), a[1], a[2],..., a[m] (a one dimensional array Output: a string "yes" or "no" Output Example: >> Enter m: 3 >> Enter : 6 >>Enter elements of A: 3,6, 8 >>Enter elements of B: 1,3, 4, 6,7, 8 >> "Yes, A is a subset of B" Another output example: >> Enter m: 4 >> Enter n: 5 >> Enter elements of A: 3, 6, 8, 9 >> Enter elements of B: 1,2,3,6, 9 "No, A is not a subset of B
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
