I have a 5gig text file that needs to be sorted in alphabetical order
What is the best algorithm to use?
constraints:
Speed – As fast as possible
Memory – A Pc with 1 Gig Ram running windows XP
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I routinely sort text files >2GB with the
sortlinux command. Usually takes 15 – 30 seconds, depending on server load.Just do it, it won’t take as long as you think.
Update Since you’re using Windows XP, you can get the sort command in UnxUtils. I use that one probably more than the linux version, and it’s equally as fast.
The bottleneck for huge files really disk speed .. my server above has a fast sata raid. If your machine is a desktop (or laptop), then your 7200 RPM (or 5400) RPM IDE drives will add a few minutes to the job.