?
Solved

Sort

Posted on 2002-04-27
3
Medium Priority
?
175 Views
Last Modified: 2010-05-02
Hi All,
I am using the QuickSort algorithm to sort an array with strings in it. There are 7500 records but soon there will be 180,000 records. I started running it last night and when I came into work this morning it was only 72% done. Is there a faster way to sort an array. Or maybe I am using QuickSort wrong. Right now I have a loop reading a text file and putting the data into an array. Every time it loops I call QuickSort. Do I need to do it this way or do I just call QuickSort once. Here is the code I am using:

        Do Until (EOF(2))
            Line Input #2, theLine
            dataArray(x) = theLine
            Call QuickSort(dataArray)
            x = x + 1
        Loop

Thank You,
Kent
0
Comment
Question by:kmurphy7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
justinhemphill earned 800 total points
ID: 6973146
Just call QuickSort once outside the loop.
0
 

Author Comment

by:kmurphy7
ID: 6973148
So my code wuold look like this:
       Do Until (EOF(2))
           Line Input #2, theLine
           dataArray(x) = theLine
           x = x + 1
       Loop

       Call QuickSort(dataArray)
Is this correct?
Thank You,
Kent
0
 

Author Comment

by:kmurphy7
ID: 6973170
Thank You for your quick response.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question