+ Reply to Thread
Results 1 to 2 of 2

Thread: Find two unique number in an array

  1. #1
    Surfer is offline Senior Member
    Join Date
    Mar 2010
    Posts
    321

    Find two unique number in an array

    You have integer array of 2n+2 elements, in which n numbers are having its 2 entries.
    You have to find the 2 numbers which is unique in the the array.

    e.g:
    {1,9,8,6,7,5,3,4,2,2,9,8,7,6,4,3,1,10}

    you program should give 5,10

  2. #2
    puspendra Guest
    1. do xor of all element of array, say it is x
    2. prepare array of xor group of two element
    3. now xor with all group of two element , group which give zero will b the result

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find an unique number in an array
    By Surfer in forum Microsoft
    Replies: 1
    Last Post: 4th October 2010, 22:20
  2. Find number of possible unique trees of n nodes
    By TopGun in forum Algorithm/Data Structure Questions
    Replies: 1
    Last Post: 23rd April 2010, 11:10
  3. Find the unique number
    By TopGun in forum Amazon
    Replies: 1
    Last Post: 23rd April 2010, 00:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts