Computer Science, asked by sharanabasavame68641, 1 year ago

5. Find the minimum length unsorted subarray, sorting which makes the complete array sorted. (given an unsorted array arr[0..N-1] of size n, you have to find the minimum length subarray arr[s..E] such that sorting this subarray makes the whole array sorted.)

Answers

Answered by danielshivasai
0
  • You need to find the shortest such subarray and output its length. Example 1: Input: [2, 6, 4, 8, 10, 9, 15] Output: 5 Explanation: You need to sort [6, 4, 8, 10, 9] in ascending order to make the whole array sorted in ascending order.
Similar questions