Algorithm for n is a integer / float with in range [4..100,000]
Answers
Answered by
12
Answer:
Algorithm for n is a integer / float with in range [4..100,000]
Answered by
2
Answer:
A non-empty array A consisting of N numeric values is
given.
Prog
The product of quadruplet(P, Q, R, S) equates to A[P]
ALQI AIR] A[S]
1
2
(OSP <Q <R<S< N).
For example array A such that:
A[2] = 2
A[O] = -3
AIST 6
A[3] = -2
A[4] = 5
A[1] - 1
A[6] = 1
KOMB), product is -3*1*2*-2 = 12
1, 2,4,5), product is 1 * 2*5*6 = 30
• (2, 4,5,6), product is 2*5*6* 1 = 60
60 is the product of quadruplets (2, 4, 5, 1), which is
maximal.
your goal is to find the maximal product of any quadruplet for input array A[].
write an efficient algorithm for the following assumption s:
N is an integer/float within the range [4...100,000]; in java
Similar questions