Which of the following is the Average Case Time Complexity fo the Bubble sort algorithm?
مندرجہ ذیل میں سے ببل سورٹ الگورتھم کے اوسط کیس ٹائم کمپلیکسٹی کیا ہے؟
- O(n²)
- O(n)
- O²(n)
- None of these
Explanation
- Bubble Sort repeatedly compares and swaps adjacent elements until the array is sorted.
- Average case involves roughly n(n-1)/2 comparisons, which gives O(n²) time complexity.
- Best case: O(n) if the array is already sorted (with optimized check).
- Worst case: O(n²) when the array is reverse sorted.
Last verified on 24-03-2026
Related MCQs
وہ کمپیوٹر پروگرام جو پروگرام کی ہدایات کو ایک وقت میں ایک ہدایت مشینی زبان میں تبدیل کرتا ہے، کیا کہلاتا ہے؟
- Interpreter
- Compiler
- CPU
- Interpreter
اس سوال کو وضاحت کے ساتھ پڑھیں
مشینی زبان کے پروگرام کے بنیادی اجزاء کیا ہیں؟
- Statements
- Directives
- Injunctions
- Instructions
اس سوال کو وضاحت کے ساتھ پڑھیں
کمپیوٹر سسٹم تک رسائی حاصل کرنے کے لیے استعمال ہونے والے کوڈ شدہ اندراجات کو کیا کہا جاتا ہے؟
- Entry Codes
- Passwords
- Security Commands
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ایک مضبوط پاس ورڈ کن چیزوں کا مجموعہ ہونا چاہیے؟
- Only alpha numeric characters
- Only special characters
- Alpha numeric characters and special characters
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ای میل میں "سی سی" کا مطلب کیا ہے؟
- Cut Copy
- Common Copy
- Combined Copy
- Carbon Copy