retagged by
936 views
0 votes
0 votes

retagged by

3 Answers

5 votes
5 votes

 

in even no.of elements position, one element is single, then there should be exist another element is single, but in the question they mention that every element is twice occurred and only one element is single, Therefore even no.of element positions doesn't have single element

1 votes
1 votes

answer is O(logn) as the array is sorted and we can apply binary search to find the position of such element. For further knowledge refer https://www.geeksforgeeks.org/find-the-element-that-appears-once-in-a-sorted-array/

0 votes
0 votes

answer is O(n) .   Use bitwise XOR manipulation.

edited by

Related questions

0 votes
0 votes
1 answer
1
1 votes
1 votes
2 answers
2
Sourabh Kumar asked May 21, 2016
1,021 views
0 votes
0 votes
2 answers
3
kamboj asked Jan 22, 2017
1,652 views
Consider X[1, ..., n] and Y[1, ..., n] be two arrays each containing n-numbers both of which are already sorted. What is the time complexity to find median by combining t...
2 votes
2 votes
2 answers
4
Akriti sood asked Jan 22, 2017
926 views
as we already know the range,so can we use counting sort??and complexity of counting sort is O(n+k)what other method is there to know the missing number??