Question: provide explaination as well Write an algorithm, NotHereAndThere(int[] A, int[] B), that takes as input two integer arrays, array A of size n and array
![provide explaination as well Write an algorithm, NotHereAndThere(int[] A, int[] B),](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3ab09284ee_06466f3ab088f0dd.jpg)
provide explaination as well
Write an algorithm, NotHereAndThere(int[] A, int[] B), that takes as input two integer arrays, array A of size n and array B of size m. Both arrays A and B store integer numbers that are in increasing orders that may or may not be the same. You can assume that both arrays A and B has no repeating numbers, but the numbers that appear in A may appear in B and vice versa. Your algorithm should print all the numbers that are not in array A and not in Array B, count the total number of elements of array A that do not occur in array B plus the number of elements of array B that do not occur in array A and print the total count. For example, if array A = {3,4,7,9,11} and array B = {1,4,6, 7, 11}, your algorithm should return 4 as the total number of elements that are not in array A and array B, and the numbers are 1,3,6,9. The runtime complexity of your algorithm should be in the order of n + m, that is, 0(n + m). Note: You are not allowed to declare a third array, but you are allowed to declare any necessary counters (variables.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
