What is the space complexity of the merge sort algorithm?
- O(n)
- O(n log n)
- O(n²)
- None of these
Explanation
- Merge Sort requires extra memory to merge sorted subarrays.
- It is not an in-place algorithm.
- Therefore, its space complexity is O(n) for an array of size n.
Additional information:
- Time complexity (Best) → O(n log n)
- Time complexity (Average) → O(n log n)
- Time complexity (Worst) → O(n log n)
- Recursion stack → O(log n)
Last verified on 24-03-2026
Related MCQs
کمپیوٹر کو دی گئی ہدایات کس زبان میں دی جاتی ہیں؟
- Assembly Language
- High-Level Language
- Machine Language
- Scripting Language
اس سوال کو وضاحت کے ساتھ پڑھیں
کمپیوٹر کی پہلی زبان کون سی تھی؟
- Pascal
- BASIC
- Cobol
- Fortron
اس سوال کو وضاحت کے ساتھ پڑھیں
درج ذیل میں سے آپریٹنگ سسٹم کی مثال کون سی ہے؟
- Photoshop
- MS Windows
- MS Word
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
مندرجہ ذیل میں سے کون سا کلائنٹ آپریٹنگ سسٹم ہے؟
- Windows Server 2016
- Windows Server 2012
- Windows 10
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
اسکرین کی تصویر کو کلپ بورڈ پر کاپی کرنے کے لیے کیا استعمال کرسکتےھیں۔
- Print screen key
- Alt key
- Both
- Shift key