0 votes 0 votes What value of $q$ does PARTITION return when all elements in the array $A[p..r]$ have the same value? Modify PARTITION so that $q=\lfloor(p+r)/2 \rfloor$ when all elements in the array $A[p..r]$ have the same value. Algorithms cormen algorithms sorting quick-sort descriptive + – akash.dinkar12 asked Jun 27, 2019 akash.dinkar12 1.7k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes If all elements in the array have the same value, PARTITION returns r. Priyansh Singh answered Nov 29, 2020 Priyansh Singh comment Share Follow See all 0 reply Please log in or register to add a comment.