You should use bitset. Space complexity is O(MaxValue/8). Time complexity is O(n + MaxValue / 32).
On 5 окт, 15:41, sourav <[email protected]> wrote: > You are given an array of positive numbers in which one number is > repeated. Rest all are present only once. Find the duplicate number in > linear or sub linear time. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
