But you can use unordered map something like what boost does ..
 
http://boost.cowic.de/rc/pdf/unordered.pdf
 
Cheers.

On Friday, June 8, 2012 5:38:56 PM UTC+8, ashgoel wrote:

> This is MS Q and hasing will give the right answer. walk over the string, 
> if it is present in hashTable, it is first repeated character. This is 
> single pass. 
>
> However, if you do another pass, your answer would be "a" which is "first 
> char that is repeated" whereas "b" is first character to occur first again 
> in the string.
>
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
> On Fri, Jun 8, 2012 at 2:15 PM, himanshu kansal <
> [email protected]> wrote:
>
>> how can we find 1st repeating character in string???
>> e.g. if the string is "abba" it should return 'b' and not 'a'.....
>>
>> note: hashing will give the answer as 'a'....
>>
>> --
>> 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.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/KV8auOcBZ9kJ.
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.

Reply via email to