title: Finding kth smallest number from n sorted arrays
body: <p>So, you have n sorted arrays (not necessarily of equal length), and you are to return the kth smallest element in the combined array (i.e the combined array formed by merging all the n sorted arrays)</p>
  
  <p>I have been trying it and its other variants for quite a while now, and till now I only feel comfortable in the case where there are two arrays of equal length, both sorted and one has to return the median of these two. 
  This has logarithmic time complexity.</p>
  
  <p>After this I tried to generalize it to finding kth smallest among two sorted arrays. <a href="https://stackoverflow.com/questions/4607945/how-to-find-the-kth-smallest-element-in-the-union-of-two-sorted-arrays">Here</a> is the question on SO.
  Even here the solution given is not obvious to me. But even if I somehow manage to convince myself of this solution, I am still curious as to how to solve the absolute general case (which is my question)</p>
  
  <p>Can somebody explain me a step by step solution (which again in my opinion should take logarithmic time i.e O( log(n<sub>1</sub>) + log(n<sub>2</sub>) ... + log(n<sub>N</sub>) where n<sub>1</sub>, n<sub>2</sub>...n<sub>N</sub> are the lengths of the n arrays) which starts from the more specific cases and moves on to the more general one?</p>
  
  <p>I know similar questions for more specific cases are there all over the internet, but I haven't found a convincing and clear answer. </p>
  
  <p><a href="https://stackoverflow.com/questions/6182488/median-of-5-sorted-arrays" >Here </a> is a link to a question (and its answer) on SO which deals with 5 sorted arrays and finding the median of the combined array. The answer just gets too complicated for me to able to generalize it.</p>
  
  <p>Even clean approaches for the more specific cases (as I mentioned during the post) are welcome.</p>
  
  <p>PS: Do you think this can be further generalized to the case of unsorted arrays?</p>
  
  <p>PPS: It's not a homework problem, I am just preparing for interviews.</p>