Answered step by step
Verified Expert Solution
Question
1 Approved Answer
*IMPORTANT* NO METHODS, MUST USE A WHILE LOOP TO CHECK IF THE ELEMENT IS IN THE SET, IF NOT THEN STOP GOING THROUGH THE LOOP,BREAK
*IMPORTANT* NO METHODS, MUST USE A WHILE LOOP TO CHECK IF THE ELEMENT IS IN THE SET, IF NOT THEN STOP GOING THROUGH THE LOOP,BREAK OUT OF THE LOOP AND STATE THAT A IS NOT A SUBSET OF B. THANKS
Write a code in java that receives two sets A and B and decides whether ACB or not Input: m (a positive integer), n (a positive integer), a[1], a[2], ..., a[m] (a one dimensional array representing A), b[1], b[2], ..., b[n] (a one dimensional array representing B) Output: a string "yes" or "no" Output Example Enter m: 3 Enter n: 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'" You are not allowed to use any packages or built in functions to find the answer directlyStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started