On Sat, Mar 12, 2011 at 05:31:06PM +0000, Rob Dixon wrote: > On 12/03/2011 15:41, ashwin ts wrote: > > > >Thank you all for the support.It helped me a lot.i tried working with arrays > >as well as with hash.Both the approaches works fine in the case of a small > >array with few elements. > >When i tried the same for a large array , i started getting "out of memory" > >error. > > > >Any suggestions would be of great help. > > Please show your code. The methods should be fine for all but a > gargantuan array.
I suspect you mean that when you store the counts in an array and your input has large values then you hit "Out of memory!" problems. In that case an array is not a suitable data structure for your problem and you should be using a hash. -- Paul Johnson - p...@pjcj.net http://www.pjcj.net -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/