Writing a Quick sort in C++

For my AP class i need to write a quick sort with iterative?? which i don't know what it means.... i can write bubble and insertion sorts but this sort confuses me i don't know where to start.. any ideas would be very helpful.. thanx
Birdman
Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Quicksort is by its very nature a recursive sort. It is not iterative. If you want a non-recursive you therefore have to make your own stack

Alf
0
Commented:
example code:
http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/qsort1a.html

Quick Sort: The quick sort algorithm contains two phases: the partition phase, which splits an array of data into two separates partitions, and the sort phase, which sorts each partition. The quick sort algorithm is extremely popular, and is also known as the "divide and conquer" method.

A quick sort algorithm divides an array of items into partitions and calls a quick sort procedure to recursively sort the partitions. Each call to the quick sort procedure divides the results into two further groups until each item in the array is ordered correctly.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
If you are allowed, you may prefer to use a linked-list class to make your list in the first place. This automatically sorts the data.
If you are not allowed to do that, then try the algorithm offered by Intern above.
0
Commented:
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.

In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Udil
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.