Quick Sort Algorithm or Source Code 
Author Message
 Quick Sort Algorithm or Source Code

I need an efficient algorithm, or code (if possible) for
QUICKSORT, and only QUICKSORT.

If anyone has this write back to this BBS.

Thanks in advance,
Jason



Wed, 18 Jun 1902 08:00:00 GMT  
 Quick Sort Algorithm or Source Code

Quote:

>I need an efficient algorithm, or code (if possible) for
>QUICKSORT, and only QUICKSORT.
>If anyone has this write back to this BBS.

Any textbook on data structures should cover sorting algorithms in some
detail.  There are plenty of bad ones out there; some are awful.  But if you
find a good one it's a desktop necessity.

Incidentally, the definitive source on such things is Knuth's "Sorting and
Searching," if you can read it.  ;-)



Wed, 18 Jun 1902 08:00:00 GMT  
 Quick Sort Algorithm or Source Code
Here is the method I found best suited to the Quick Sort in Pascal:

RECURSIVE
=========

PROCEDURE Partition ( VAR List   : El_Array, First, Last : integer;
                      VAR PivInd : integer );

VAR
  Pivot : integer;
  Up

PROCEDURE Quick_Sort ( VAR List : El_Array; First, Last : integer );

VAR
  PivInd : integer;
  Up     : integer;
  Down

BEGIN
  IF ( First < Last ) THEN
  BEGIN
    Partition  ( List, First, Last, PivInd );
    Quick_Sort ( List, First, ( PivInd - 1 ) );
    Quick_Sort ( List, ( PivInd + 1 ), Last );
  END;
END;



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Quick sort code needed for BP7

2. Code for quick sort

3. Most efficient sort text file routine, sort algorithms

4. Source Code Needs Sorting...

5. Need program for convert C++ source code to Pascal source code (Delphi)

6. Counting Comparisons in a Sorting Algorithm

7. Help! sorting algorithm

8. Independent Type Algorithm (Eg: Sorting)

9. sort algorithm trouble...

10. algorithm to calculate the median using a sorted array

11. algorithm to calculate the median for a sorted array

12. Help me searching a sorting algorithm

 

 
Powered by phpBB® Forum Software