Question: Given an array, A, of n 2 unique integers in the range from 1 to n, describe an O(n)-time method for finding the two
Given an array, A, of n − 2 unique integers in the range from 1 to n, describe an O(n)-time method for finding the two integers in the range from 1 to n that are not in A. You may use only O(1) space in addition to the space used by A.
Step by Step Solution
3.47 Rating (167 Votes )
There are 3 Steps involved in it
Compute the sum of all the integers in A and compu... View full answer
Get step-by-step solutions from verified subject matter experts
