Design a linear time algorithm for finding the least positive integer missing from an unsorted array. Changes in the array are allowed.For example, for the array -10,-1,2,3,6,30, the answer is 1.I thought about finding the maximum and minimum numbers in the array (this is $\Theta(n)$), then a loop from the minimum number to the maximum number, and in every iteration, check if the current number is in the array, but this will take $\Theta(n^2)$. 
Linear time algorithm for least positive integer missing from array
algorithms
You could do radix sort with counting sort if your input matches the criteria for these algorithms (this is O(n) ). Another way would be creating a vector of bool the size of the input. Initialize all elements to false. Once you encounter a positive integer, set the index of this positive integer to true if it is within the bounds of the vector size. Once this is done you can traverse this vector and the first false value you find is the least positive integer missing.