You are given two arrays: Array1 and Array2. Array1 will be sorted. For each element v in Array2, you need to write a pseudocode that will print the number of elements in Arr1 that is greater than or...


Use Python only.


You are given two arrays: Array1 and<br>Array2.<br>Array1 will be sorted. For each element<br>v in Array2, you need to write a<br>pseudocode that will print the number<br>of elements in Arr1 that is greater than<br>or equal to v and the element must<br>be a prime number. For example: if I<br>give you two arrays of size 5 and 4<br>5 4 [size of two arrays]<br>Arri = 13579<br>Arr2 = 6 4 8<br>The output should be: 12 o<br>There are two parts in the question.<br>First you need to know how many<br>numbers are there in Array1 which are<br>greater than 6. Here, we find there are<br>two numbers (7,9). Then we need to<br>find whether these numbers are prime<br>or not. The searching portion must not<br>take more than O(log n) time.<br>Sample input<br>Sample output<br>55<br>23111<br>37 10 12 17<br>61 14 8 9<br>

Extracted text: You are given two arrays: Array1 and Array2. Array1 will be sorted. For each element v in Array2, you need to write a pseudocode that will print the number of elements in Arr1 that is greater than or equal to v and the element must be a prime number. For example: if I give you two arrays of size 5 and 4 5 4 [size of two arrays] Arri = 13579 Arr2 = 6 4 8 The output should be: 12 o There are two parts in the question. First you need to know how many numbers are there in Array1 which are greater than 6. Here, we find there are two numbers (7,9). Then we need to find whether these numbers are prime or not. The searching portion must not take more than O(log n) time. Sample input Sample output 55 23111 37 10 12 17 61 14 8 9

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here