+ Reply to Thread
Results 1 to 2 of 2

Thread: Find an unique number in an array

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

    Find an unique number in an array

    You have integer array of 2n+1 elements, in which n numbers are having its 2 entries.
    You have to find the 1 number 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}

    you program should give 5

  2. #2
    puspendra Guest
    do xor of all element of array..

+ 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. Replies: 2
    Last Post: 1st July 2010, 00:48
  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