Solved

Sort

Posted on 2002-04-27
3
173 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

733 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