GeeksforGeeks » Algorithms
Maximizing valleys in an unsorted array:
(1 post)-
A Valley is cell (in an array) which has less value than its immediate neighbours. Given an unsorted array, the task is to rearrange the numbers in such a manner so as to maximize the number of valleys in that array.
Now redefine the Valley to extend the problem. A Valley is now a cell which has value less by a given threshold than its immediate neighbours.
The first part seems easy. Please suggest solutions for the extended problem.
Reply
You must log in to post.