[algogeeks] first unrepeated char

2010-10-12 Thread Asquare
Given a string,find the first un-repeated character in it? Im getting O(n2) or O(mn) Anyone with a solution of lower complexity..?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] first unrepeated char

2010-10-12 Thread Mukesh Gupta
take two integer arrays A and B of size 26 ,A is for storing count and B is for index .Initialize both the array with 0's. Then iterate through the string once and keep incrementing the respective character count in A and store the character index in B. Now in array B find the minimum index whose