Question: My problem: Can you help me design an algorithm? The time complexity of this algorithm will be O(n^2). Introduction: At frist, we have array Q[1:n],

My problem: Can you help me design an algorithm? The time complexity of this algorithm will be O(n^2).

Introduction: At frist, we have array Q[1:n], W[1:n], E[1:n]. The three arrays are all made up of positive integers. I need to find if there are numbers in Q and W whose multiplication belongs to E.

Those two examples will help you better understand my goal:

1. If Q = [4, 5, 6], W = [6, 7, 8] and E = [1, 24, 2] --- we will get the answer yes. --- Q[1] * W[1] = E[2]

2. If Q = [99, 100, 78], W = [6, 7, 8] and E = [1, 2, 3] --- we will get the answer no'

Recommend: you do not need give me real code. Procedure code and clear explanation thats all I need.

I will give upvote for timely and correct answer. Thank you!!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!