1 votes 1 votes What is the running time of QUICKSORT when all elements of the array $A$ have the same value? Algorithms cormen algorithms quick-sort time-complexity descriptive + – akash.dinkar12 asked Jun 27, 2019 akash.dinkar12 530 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Satbir commented Jun 27, 2019 reply Follow Share $O(n^2)$ 0 votes 0 votes smsubham commented Dec 17, 2019 reply Follow Share https://math.stackexchange.com/questions/22596/quicksort-running-time 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes Total comparison =( n-1)+(n-2) +.....n =O(n²) Quick sort will do worst case time complexity if array is already sorted ie O(n²) sharon27 answered Jun 27, 2019 sharon27 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes All the Elements have same values ,treated as sorted therefore worst case complexity , ie O(n^2) Sanandan answered Sep 11, 2020 Sanandan comment Share Follow See all 0 reply Please log in or register to add a comment.