I am learning about quicksort and want to illustrate different arrays that quicksort would have a hard time on. The quicksort I have in mind does not have an initial random shuffling, does 2 partition, and does not compute the median.
I thought up of three examples so far:
[1,2,3,4,5,6,7,8,9,10] - when the array is sorted
[10,9,8,7,6,5,4,3,2,1] - when the array is reversed
[1,1,1,1,1,1,1,1,1,1] - when the array is the same values
[1,1,1,2,2,2,3,3,3,3] - when there are few and unique keys
Are there any more examples you can think of? ForFor instance, I'm not too sure about this one:
[1,3,5,7,9,10,8,6,4,2]
So what makes for an array that quicksort has difficulty with compared to one where it is (nearly) ideal?