Modified Quicksort algorithm
  • recursion
  • array
  • sorting
  • quicksort
  • Posted: 5 years ago
  • Edit
  • answers (1)
  • views (6956)

In Quicksort algorithm, there are two recursive calls to itself - after PARTITION, the left subarray is recursively sorted and then the right subarray. How will you modify Quicksort algorithm so that the second recursive call on the right subarray can be avoided, but sorted correctly.

Posted Answers

while(p < r)
/* Partition and sort left subarray */
q = PARTITION(A,p,r);
p = q+1;

You need to Sign In to post your solution.