Out of stack space

I have an ASP page that brings in a 2D array of data and prints it, sorts it and searches it.  Am having a problem with the sort algorithm.  Have a QuickSort algorithm which works and has good time runs.  Problem is when I attempt to sort a column with mostly the same data in it, I get the out of stack space error.
(Microsoft VBScript runtime error '800a001c'  Out of Stack Space).  I know that this error is popping up because my sort uses recursion and when you have a lot of the same data being sorted, that function is being called many times.  What I want to know is if there is any way and if it is safe to increase the Stack Space or if I should go with a different algorithm?  Which brings me to my second question.  I have been trying to run a shell sort algorithm but keep getting small errors in my results.  For example say we have the following elements in the array (A,B,B,C,B,A,A,A,B,C,B,C)  The sorted array will come out as follows:
(A,A,A,B,A,B,B,B,C,B,C,C)  I can't figure out if its the amount of data I am attempting to sort or if I'm just screwing up.  I guess if anyone has some good vbscript quicksort or shell sort algorithms that are proven and and willing to share those, I would appreciate it.  Thanks.
pacino_manAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

AzraSoundCommented:
discussion of sorting algorithms and samples in VB, translation to VBScript should be no problem:

http://www.vb-helper.com/tut1.htm

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.

Start your 7-day free trial
GEM100Commented:
listening...
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
Web Development

From novice to tech pro — start learning today.