Hi, > > Do you need the fastest possible sort?
I'm not even sure if I really need to worry about all these sorting techniques. My program just reads a text file (wordlist). It might be megabyte-sized or probably few gigabytes (i might also add size checking on this to be safe with File::Slurp). Then I will give the user an option of sorting it in various ways, like length, alphabetical, numerical, frequency of letters, etc. I see, so it all boils down to how expensive the comparison you're going to implement to fully benefit from these techniques. Now comes another question for me to find the answer to, how expensive the comparisons in my sorting function would be... I guess there's no other way for me to find this out than to try it out myself. What's worse is that there's also a "depends on the system" factor to consider as well. Sometimes I wish perl's motto is "there's only one best way to do it" so everyone would just agree on one way of doing something, so everyone would have the same beautiful and efficient code. For now, I will probably just stick to using the built-in sort (just for sorting length, numbers, and letters), until I have gained enough knowledge about why it's necessary to use the other techniques, or how to do the benchmark myself. > Philip > PS your email client has a very long line length, causing my quoting > above to go somewhat haywire. I'd recommend setting it to something > like 74. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/