Array A contains positive numbers that can be smaller than 1, larger than 1, or equal to 1. Find the sub-array A[i..j],

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Array A contains positive numbers that can be smaller than 1, larger than 1, or equal to 1. Find the sub-array A[i..j],

Post by answerhappygod »

Array A Contains Positive Numbers That Can Be Smaller Than 1 Larger Than 1 Or Equal To 1 Find The Sub Array A I J 1
Array A Contains Positive Numbers That Can Be Smaller Than 1 Larger Than 1 Or Equal To 1 Find The Sub Array A I J 1 (25.44 KiB) Viewed 21 times
THE NUMBERS ARE ALL POSITIVE. DO NOT CHECK FOR NEGATIVE NUMBERS.
Please make sure a product of 2 numbers will be computed in O(1)
time and explain why it is correct.
Array A contains positive numbers that can be smaller than 1, larger than 1, or equal to 1. Find the sub-array A[i..j], such that the product of numbers in A[i..j] (i.e., A × A[i+1] x ... × A[j - 1] × A[j]) is maximized. Of course, you should describe the fastest algorithm that you can find. A product of two numbers can be computed in time O(1). Describe your algorithm in words, provide a pseudocode and briefly explain why your algo- rithm is correct.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply