1 votes 1 votes In Randomized Quick sort, Can we have partitioning algorithm that never gives worst case as $O(n^2)$ for every input? Algorithms algorithms quick-sort + – Angkit asked Mar 29, 2018 • retagged Mar 29, 2018 by Sukanya Das Angkit 560 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Randomized Quick sort worst case is o(n^2). suppose we take a pivot element and it is divided(partitioning) the array in two sub array . like one array have 0 element and other array have n-1 element then recurrence relation become T(n)=T(n-1)+o(n). time complexity=o(n^2) abhishekmehta4u answered Mar 29, 2018 • edited Mar 29, 2018 by abhishekmehta4u abhishekmehta4u comment Share Follow See all 2 Comments See all 2 2 Comments reply Angkit commented Mar 29, 2018 reply Follow Share What about partition algorithim? 0 votes 0 votes abhishekmehta4u commented Mar 29, 2018 reply Follow Share Partition will always take o(n) in worst case. 0 votes 0 votes Please log in or register to add a comment.