Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 03-18-2005, 07:05 PM   #1 (permalink)
 
Newb Techie

Join Date: Mar 2005

Posts: 3

manu2011

Default non-recursive quicksort

can you give me a non recursive version of quicksort that uses a stack. the version should store at the stack indicies[i,j] of subarrays that have not been sorted yet.
what is the number of [i,j] pairs, non-sorted subarrays that can belong to stack simultaneously.
manu2011 is offline  
Old 03-20-2005, 05:42 PM   #2 (permalink)
 
Monster Techie

Join Date: Sep 2004

Posts: 1,447

Alex81388

Send a message via AIM to Alex81388
Default

That would be a long sort, thats why they use recursion.
__________________
Sig removed due to foul language. Please read the rules regarding the allowable content of sigs before reposting your COMPLIANT sig.
~Trotter
4/21/06
Alex81388 is offline  
Old 06-12-2005, 07:38 PM   #3 (permalink)
 
Newb Techie

Join Date: Jun 2005

Posts: 1

johng

Default

Hi, Virgin Techie,
I wrote a non-recursive quicksort as a part of a QB45 program in 1989 when I indexed the KJV of the Bible as I was tired of carrying around a Strong's Concordance when I went to a Thursday night Bible study group at a friend's house. Let me know if this would help you. The source code is easy to follow. It's not much longer than the recursive code, and it is faster.
John
johng is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On