Pakistan's best MCQs practice hub — FPSC · PPSC · CSS · NTS · Other Exams
Login

What is the worst-case time complexity of the standard QuickSort algorithm when selecting a poor pivot element on an already sorted array?

AO(n log n)
BO(n)
CO(n²)
DO(log n)

Explanation

QuickSort uses Divide and Conquer. While its average time complexity is O(n log n), choosing an extreme element (smallest or largest) as pivot on a sorted array results in worst-case time complexity of O(n²).

Exam Relevance
  • Topic: Data Structures & Algorithms
  • Subtopic: Sorting Algorithms & Complexity
Submitted by: mcqstutor Team More Computer MCQs →

No Comments

Leave a comment

Your email address will not be published. Required fields are marked *