@Arjun Sir what is the meaning of 1) The array is already sorted in same order.

is it mean elements are in ascending order?

is it mean elements are in ascending order?

The Gateway to Computer Science Excellence

+14 votes

Assume that the last element of the set is used as partition element in Quicksort. If $n$ distinct elements from the set $\left[1\dots n\right]$ are to be sorted, give an input for which Quicksort takes maximum time.

52,345 questions

60,470 answers

201,795 comments

95,272 users