In class today I had my students write (copy from textbook) a recursive Quick Sort in Python 3.2. I gave them a text file of 10,000 integers in reverse order (to illustrate worse case scenario). When students created a list of strings to sort, their code worked properly. If a student used a list of integers (converted from the text file input), their code crashed with a maximum recursion depth exceeded error. Any thoughts on why using a list of integers causes these results?
FYI - I could change a student's code from int to string lists, and vice versa, and consistently recreate the problem.
inton the values, or are the values converted toint()first, then sorted?import sys sys.setrecursionlimit(10000), or higher, to see if you ever reach your base cases and it is simply worst case recursion. See this link