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
فشنگ عام طور پر کس مقصد کے لیے کی جاتی ہے؟
- 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
اس سوال کو وضاحت کے ساتھ پڑھیں
اگر کسی نامعلوم بھیجنے والے کی ای میل میں مشکوک اٹیچمنٹ ہو تو سب سے محفوظ طریقہ کیا ہے؟
- Avoid opening it and verify the sender/message
- Open it immediately
- Forward it to colleagues
- None of these
اس سوال کو وضاحت کے ساتھ پڑھیں
اینٹی وائرس سافٹ ویئر کا کیا کام ہے؟
- Protect against malware and viruses
- Detect and help protect against malicious software
- Create and edit spreadsheets
- Both A and B