IV. (15 points) Let A[1..n] be an array of n numbers, where n 22, sat- isfying that there is an index 1
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
IV. (15 points) Let A[1..n] be an array of n numbers, where n 22, sat- isfying that there is an index 1
IV. (15 points) Let A[1..n] be an array of n numbers, where n 22, sat- isfying that there is an index 1<i<n such that all the numbers in the subarray A[1..] are positive and all the numbers in the subarray Ali+1..n) are negative. Note that the index i is not given (i.e., is not. known). Give an O(lg n)-time algorithm that computes the index i.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!