What is the worst case time complexity of a quick sort algorithm?
فوری ترتیب والے الگورتھم کی بدترین صورتحال کا وقت کی پیچیدگی کیا ہے؟
- O(log N)
- O(N log N)
- O(N²)
- None of these
Explanation
- Quick Sort is a divide-and-conquer sorting algorithm.
- In the worst case, it occurs when the pivot divides the array very unevenly (e.g., always smallest or largest element).
- This results in O(n²) comparisons for an array of size n.
Additional information:
- Average case → O(n log n)
- Best case → O(n log n)
- Worst case → O(n²)
Last verified on 23-03-2026
Related MCQs
مصنوعی ذہانت کے لئے مندرجہ ذیل میں سے کون سی مشترکہ زبان ہے؟
- LISP
- JAVA
- Python
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
آئی پی ایڈریس کا مقصد کیا ہے؟
- To uniquely identify a device on a network
- To encrypt internet connections
- To speed up downloads
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
درج ذیل میں سے نیٹ ورک ٹوپولوجی کون سی ہے؟
- Bus
- Star
- Ring
- All of these
اس سوال کو وضاحت کے ساتھ پڑھیں
چہرے کی شناخت کس کی نمایاں مثال ہے؟
- Artificial Intelligence (AI)
- Cybersecurity
- Cloud Computing
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ریم کونسی میموری ہے؟
- Permanent
- Volatile
- Primary Memory
- None of these