Question: Given two arrays: A[0..m-1] and B[0..n-1] write pseudo code in C++ for determining whether B is a subset of A. Assume that the arrays are
Given two arrays: A[0..m-1] and B[0..n-1] write pseudo code in C++ for determining whether B is a subset of A. Assume that the arrays are not in sorted order and that the elements of each array are distinct. Demonstrate your solution using a Hash Table and evaluate the complexity of your algorithm.
Examples:
Input: A = {11, 1, 13, 21, 3, 7}, B = {11, 3, 7, 1}
Output: B is a subset of A
Input: A = {10, 5, 2, 23, 19}, B = {19, 5, 3}
Output: B is not a subset of A
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
