Skip to content

Maximum recursion depth #1

Description

@StPfeffer

Maximum recursion depth exceed when using Quick Sort.

This issue has already been discussed here on Stack Overflow.

While QuickSort is O(NlogN) with most lists, it has a worst case of O(N^2) - in particular (using the standard pivot rules) with already-sorted lists. And when this happens, your stack depth can end up being O(N). So, if you have 1000 elements, arranged in worst-case order, and you're already one frame into the stack, you're going to overflow.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions