[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Sort

Posted on 2002-04-27
3
Medium Priority
?
176 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

Industry Leaders: 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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

649 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