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
کون سا کمپیوٹر نیٹ ورک قسم بڑی جگہوں، جیسے اضلاع یا شہروں کو جوڑتا ہے؟
- LAN
- WAN
- MAN
- PAN
اس سوال کو وضاحت کے ساتھ پڑھیں
ریم سے کیا مراد ہے؟
- Random Access Memory
- Random Access Money
- Random Accurate Memory
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
اسپیم یا جنک ای میل کیا ہوتی ہے؟
- Official government email
- Important personal email
- Unwanted or unsolicited email
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
کسی مسئلے کو حل کرنے کے لیے دی گئی ہدایات یا مراحل کے مجموعے کو کیا کہتے ہیں؟
- Procedure
- Method
- Algorithm
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
ڈیٹا کی ایک جگہ سے دوسری جگہ منتقلی کو کیا کہتے ہیں؟
- Data processing
- Data distribution
- Data communication
- Data encryption