## Help authour, Buy PDF Ebook
>>>**Click Here**<<<

## Quicksort using Random Sampling Multiple choice Questions and Answers (MCQs)

Question 1 |

Quick sort uses which of the following algorithm to implement sorting?

backtracking | |

greedy algorithm | |

divide and conquer | |

dynamic programming |

**Reasoning Questions answers**

Question 1 Explanation:

Quick sort uses the technique of divide and conquer in order to sort a given array. It divides the array into two parts about the pivot and then apply a quick sort to both the parts.

Question 2 |

What is a randomized quick sort?

quick sort with random partitions | |

quick sort with random choice of pivot | |

quick sort with random output | |

quick sort with random input |

**Economics Questions answers**

Question 2 Explanation:

Randomized quick sort chooses a random element as a pivot. It is done so as to avoid the worst case of quick sort in which the input array is already sorted.

Question 3 |

What is the purpose of using randomized quick sort over standard quick sort?

so as to avoid worst case time complexity | |

so as to avoid worst case space complexity | |

to improve accuracy of output | |

to improve average case time complexity |

**EVS Questions answers**

Question 3 Explanation:

Randomized quick sort helps in avoiding the worst case time complexity of O(n2) which occurs in case when the input array is already sorted. However the average case and best case time complexities remain unaltered.

Question 4 |

What is the auxiliary space complexity of randomized quick sort?

O(1) | |

O(n) | |

O(log n) | |

O(n log n) |

**GK Questions answers**

Question 4 Explanation:

Auxiliary space complexity of randomized quick sort is O(log n) which is used for storing call stack formed due to recursion. Note that the algorithms with space complexity as O(log n) also qualifies as in place algorithms as the value of log n is close to 1.

Question 5 |

What is the average time complexity of randomized quick sort?

O(n log n) | |

O(n ^{2}) | |

O(n ^{2} log n) | |

O(n log n ^{2}) |

**Education Questions answers**

Question 5 Explanation:

The average case time complexity of randomized quick sort is same as that of standard quick sort as randomized quick sort only helps in preventing the worst case. It is equal to O(n log n).

There are 5 questions to complete.