@deepika....your solution is not O(n) i guess... @Sachin....the question says compress the *same* string. By 'printing' i dont know what you mean....
On Fri, Aug 5, 2011 at 5:17 PM, deepikaanand <swinyanand...@gmail.com>wrote: > static int array[256]; > removedupli(char s[],int n) > { > array[s[0]]=1; > for(i=1;i<n;i++) > { > if(array[s[i]]==0) > array[s[i]]=1; > else > { > for(pos=i;i<n;i++) > s[pos]=s[pos+1]; > i--; > > -- > 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. > > -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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.