Solved

Sort

Posted on 2002-04-27
3
171 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
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
justinhemphill earned 200 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 55
Determine Range to Select 5 48
How to debug this code 7 61
Prevent user closing word document opened with VB6 6 74
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

777 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