Re: [Tutor] counter not working in Quick Sort script

2015-10-30 Thread Patti Scott via Tutor
not working in Quick Sort script To: tutor@python.org Date: Thursday, October 29, 2015, 9:12 PM On 29/10/15 19:11, Patti Scott via Tutor wrote: Caveat: I didn't check the algorithms for correctness, I'll just take your word for that. > My accumulator variable to cou

Re: [Tutor] counter not working in Quick Sort script

2015-10-29 Thread Alan Gauld
On 29/10/15 19:11, Patti Scott via Tutor wrote: Caveat: I didn't check the algorithms for correctness, I'll just take your word for that. My accumulator variable to count the number of comparisons returns nonsense. def quick_sort(A, start, stop, count): if start < stop: # incre

[Tutor] counter not working in Quick Sort script

2015-10-29 Thread Patti Scott via Tutor
Mac OS 10.10 Python 3.4.3 I self-study Python and am using it for a Coursera algorithm class. Hi! My script sorts correctly on all my test arrays. My accumulator variable to count the number of comparisons returns nonsense. I'm counting the (length - one) of each sublist that will be sorted in