Question DSA-SRCH-0020
HardHow can you find the median of two sorted arrays of sizes m and n in O(log(min(m, n))) time?
- A.
Merge both arrays
- B.
Use a hash map
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Searching and Binary Search question
How can you find the median of two sorted arrays of sizes m and n in O(log(min(m, n))) time?
Merge both arrays
Use a hash map
Sign up free to see the answer and a step-by-step explanation.
Binary search for a partition of the smaller array that balances the left and right halves
Sort the combined array