Hi

Mere removal is enough ? Shifting not necessary ?

If yes, then

we can have something like this. But let me know if this sounds ok and any
further improvements.

int chars = new int[256];
int values = new int[10]; // say 10 chars
for(i = 0; i < 10; i++) {
    int charVal = toascii(values[i]);
    chars[charValue]++;
    if(chars[charValue] > 1)
      // remove from array.
      values[i] = 0; // some other sentinel value ?
}


Rgds
Supraja J

On Thu, Jun 2, 2011 at 12:19 PM, D.N.Vishwakarma@IITR <deok...@gmail.com>wrote:

> better than O(n2) algo
>
> --
> **With Regards
> Deoki Nandan Vishwakarma
> IITR MCA
> Mathematics Department*
> *
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@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.
>



-- 
U

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@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