Question: Question 3: Given a non sorted array A of size n 2 that contains all the numbers 1 , 2 , 3 , . .
Question 3: Given a non sorted array A of size n 2 that contains all the numbers 1 , 2 , 3 , . . . , n except for two. Give an algorithm to find the two missing numbers. Use a constant extra space (namely apart from the array, only a constant number of variables). If this is hard for you use as much space as you want (you will loose some points but not too much).
Example of such array. For n = 13. The next array of 11 elements contains all the numbers from 1 to 13 but 7 and 11: < 12 , 6 , 1 , 8 , 4 , 9 , 12 , 3 , 5 , 13 , 2 > .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
