>> I tried writing a naive implementation of quicksort using an
>> accumulator. Right now, the code is stack-consuming and returns a
>> stackoverflowerror on large lists. Is there any way to prevent it from
>> consuming stack with some changes? The code is as follows -
>
> You don't say what your t
On Tue, 28 Dec 2010 19:50:28 +0530
Baishampayan Ghose wrote:
> Hello,
>
> I tried writing a naive implementation of quicksort using an
> accumulator. Right now, the code is stack-consuming and returns a
> stackoverflowerror on large lists. Is there any way to prevent it from
> consuming stack wi
And also qsort may take up to n stack frames for collection of n
elements if you partition function is not optimal. In your case - if
input collection is sorted (as long as you split by first element).
On Tue, Dec 28, 2010 at 11:13 PM, Petr Gladkikh wrote:
> Why do you call qsort* inside of parti
Why do you call qsort* inside of partify? I do not really grasp your
logic behind this.
On Tue, Dec 28, 2010 at 8:20 PM, Baishampayan Ghose wrote:
> Hello,
>
> I tried writing a naive implementation of quicksort using an
> accumulator. Right now, the code is stack-consuming and returns a
> stacko
Hello,
I tried writing a naive implementation of quicksort using an
accumulator. Right now, the code is stack-consuming and returns a
stackoverflowerror on large lists. Is there any way to prevent it from
consuming stack with some changes? The code is as follows -
(declare qsort qsort* partify)