0 votes 0 votes How to find the time complexity if finding the median of 2 sorted arrays? Algorithms algorithms divide-and-conquer time-complexity descriptive + – Hardik Vagadia asked Aug 22, 2016 • retagged Jul 7, 2022 by Lakshman Bhaiya Hardik Vagadia 412 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Sushant Gokhale commented Aug 22, 2016 reply Follow Share @Hardik. There is O(n) time algorithm for finding median. But, I dont know the logic behind it. I have never seen the algo. 1 votes 1 votes Hardik Vagadia commented Aug 23, 2016 reply Follow Share Well this question is from Gateforum's study material and according to them, O(logn) is the answer. The solution the have provided is : Comparing the median on each array and based on which the array size into consideration is halved in every iteration. 0 votes 0 votes pC commented Aug 23, 2016 reply Follow Share propose an algorithm and find the complexity . AFAIK There is no standrad algorithm for finding meadian of 2 arrays . Complexity entirely depends on algorithm we write . 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes It depands on algorithm we use. see http://www.geeksforgeeks.org/median-of-two-sorted-arrays/ Amit Prakash Tiwari answered Aug 24, 2016 Amit Prakash Tiwari comment Share Follow See all 0 reply Please log in or register to add a comment.