You are given an array (zero indexed) of n non-negative integers, a0, a1 ,, an-1. Find the minimum sub array al, al+1 ,, ar so if we sort(in ascending order) that sub array, then the whole array should get sorted. If a is already sorted, output -1.
Answers
Answered by
0
You have to find the smallest positive number missing from the array in O(n) time ... non-positive (0 and negative) numbers on left ... int findMissingPositive
Similar questions
Math,
5 months ago
Geography,
5 months ago
Science,
5 months ago
Business Studies,
10 months ago
Business Studies,
10 months ago
Math,
1 year ago
Psychology,
1 year ago