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
ایچ ڈی ایم آئی کیبل کا کیا کام ہے؟
- To connect audio and video devices
- To transmit internet signals
- To connect storage devices
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
بٹ کوائن کس ٹیکنالوجی کو استعمال کرتا ہے؟
- Hashgraph
- Blockchain
- DAG
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
فشنگ عام طور پر کس مقصد کے لیے کی جاتی ہے؟
- Install legitimate updates
- Improve computer performance
- Obtain sensitive information through deceptive messages or websites
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
مضبوط پاس ورڈ کا بنیادی مقصد کیا ہے؟
- Protect an account from unauthorized access
- Improve screen resolution
- Increase internet speed
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
براؤزر میں بک مارک کا بنیادی مقصد کیا ہے؟
- Remove viruses
- Delete browsing history
- Save a webpage for easier future access
- None of these