Friday, July 31, 2009

Quicksort Algorithm Program in C++ Help?

You should write a program that goes through partitioning and recursive sets and create a program that does a quicksort. Write a recursive function to sort a single-subscripted


integer array. The function should receive as arguments an integer array, starting subscript


and an ending subscript. Function partition should be called by the recursive quickSort


function to perform the partitioning step. You should use the principle of least privilege


and pass-by-reference with pointers for passing arguments to functions.


You should generate 10 numbers randomly to test your program.





Expected Output:





Initial Values:





70 674 335 209 420 548 406 437 990 313





The sorted array values are:


70 209 313 335 406 420 437 548 674 990





This is in my C++ book (C++ How to Program 5th Edition by Dietel). Any idea as to how to do this? I'd really appreciate help. Thanks!

Quicksort Algorithm Program in C++ Help?
Exercise 8.24 pretty much tells you how to do it.
Reply:If you are still stuck, may be you can contact a C++ expert live at website like http://askexpert.info/ .


No comments:

Post a Comment