• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

pseudocode for iterative quickSort

Sadaiyappan

Golden Member
Hi! I'm supposed to write a quickSort that is non recursive. So I guess I will need to use loops and maybe a stack to do this. But I don't know where to start or how to do this. Can someone link to me a tutorial / guide (I can't find any good ones for C++ on google) or paste the pseudocode here for me???
 
Also if I do use a stack I'm a little confused about how to implement the array. Do i put the array within the struct of the interface of the stack? Or do i create an array based stack? Or create a pointer based stack then create an array of objects? I am supposed to be able to sort 200,000 integers.
 
A quick search of "iterative quicksort" yielded a bunch of results, many with code. I haven't looked at the implementation for quicksort in a couple of years so I can't directly help you, but before you will be able to write/understand an iterative implementation of it you should really have a firm understanding of how the sort works. If you really understand the algorithm, it's trivial to write it as either iterative or recursive.
 
Awesome, you want to do this for a living I am assuming, but you refuse to think for yourself. You will go no where with this kind of attitude.
 
Back
Top