1 1 vote 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 1.0k views answer comment Share Follow Print See all 2 Comments 2 2 Comments reply Satbir commented Jun 27, 2019 reply Follow flag $O(n^2)$ 0 0 replyShare smsubham commented Dec 17, 2019 reply Follow flag https://math.stackexchange.com/questions/22596/quicksort-running-time 0 0 replyShare Please log in or register to add a comment.
1 1 vote 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 0 reply Please log in or register to add a comment.
0 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 0 reply Please log in or register to add a comment.