Are all the numbers within some given range?
If so then keep a count of all and later find out the non repeating one.

otherwise, make  a balanced BST and insert every element in it and increment
the counter of the node if already present in the tree and then do inorder
traversal to find out the non repeating element.

Anurag Sharma


On Sun, Jun 13, 2010 at 11:44 PM, jalaj jaiswal
<jalaj.jaiswa...@gmail.com>wrote:

> give an algo to find a unique number in an array
>
> for eg a[]={1,3,4,1,4,5,6,1,5}
>
> here 3 is the unique number as it occur only once... moreover array
> contains only 1 unique number
>
>
>
> --
> With Regards,
> Jalaj Jaiswal
> +919026283397
> B.TECH IT
> IIIT ALLAHABAD
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to