Which of the following is the Best Case Time Complexity of the Bubble Sort algorithm?
- O(n)
- O(n²)
- O²(n²)
- None of these
Explanation
- Best case occurs when the array is already sorted.
- With an optimized Bubble Sort (using a swap flag), no swaps are needed.
- The algorithm makes only one pass, resulting in O(n) time.
Additional information:
- Average case → O(n²)
- Worst case → O(n²)
- Comparisons in best case → (n − 1)
- Swaps → 0
Last verified on 24-03-2026
Related MCQs
کمپیوٹر کا جسمانی حصہ کسے کہتے ہیں؟
- Software
- Hardware
- Both A and B
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
کس قسم کے ٹرمینل میں اپنا پروسیسر ہوتا ہے اور جو آزادانہ طور پر حساب کتاب اور ڈیٹا پراسیس کر سکتا ہے؟
- Dumb Terminal
- Smart Terminal
- Intelligent Terminal
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
سافٹ ویئر یا ہارڈ ویئر میں خرابی کو بگ کہا جاتا ہے۔ اس کے لیے متبادل کمپیوٹر جرگن کیا ہے؟
- Glitch
- Squid
- Slug
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
سمورغ نامی سپر کمپیوٹر کس ملک نے تیار کیا ہے؟
- China
- Japan
- Iran
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
سی پی یو کے اندر کون سی میموری نصب ہوتی ہے؟
- RAM
- ROM
- Register
- None of these