- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- Which is the worst method of choosing a ...

Q. |
## Which is the worst method of choosing a pivot element? |

A. | first element as pivot |

B. | last element as pivot |

C. | median-of-three partitioning |

D. | random element as pivot |

Answer» A. first element as pivot | |

Explanation: choosing the first element as pivot is the worst method because if the input is pre-sorted or in reverse order, then the pivot provides a poor partition. |

View all MCQs in:
Design and Analysis of Algorithms

- Worst case is the worst case time complexity of Prim’s algorithm if adjacency matrix is used?
- Which is the safest method to choose a pivot element?
- Which of the following methods is the most effective for picking the pivot element?
- Which of the following takes O(n) time in worst case in array implementation of stack?
- What is the worst case time complexity of KMP algorithm for pattern searching (m = length of text, n = length of pattern)?
- Rabin Karp algorithm and naive pattern searching algorithm have the same worst case time complexity.
- What is the worst case time complexity of a quick sort algorithm?
- What is the worst case complexity of quick hull?
- In the worst case, the minimum number of insertions to be made to convert the string into a palindrome is equal to the length of the string.
- The worst-case efficiency of solving a problem in polynomial time is?

Login to Continue

It will take less than 2 minutes

Report MCQ