Use an additional tmp variable initialized with -1, then kind of sort the array in place using tmp as position n :
function find_missing(array)
begin
tmp := -1
i := 0;
while i<length(array)
if (array[i] = -1) or (array[i] = i) then
// either on a cell with the right number or
// a candiate for the missing number, just go on
i := i + 1
else if array[i] = n then
// use tmp as the nth cell
array[i]=tmp
tmp=n
else
// swap the value of the current cell with the value
// of the cell were the value i should be
swap(array, i, array[i])
end if
end while
end
-1 should point to the missing number.