top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is min time taken to find kth smallest element in the merged sorted array of 3 sorted array?

+1 vote
1,472 views

Given 3 sorted array of size x, y, z. what is the minimum time taken to find the kth smallest element in the merged sorted array.

posted Oct 21, 2013 by Neeraj Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

Complexity O(K).
Use merge concept.

answer Nov 8, 2013 by Vikas Upadhyay
0 votes

Have to traverse until met k diff numbers.
ex. 1111 2222 3333

merged **********

we need to loop for 9 counts.

There may alternate approach too.

answer Oct 22, 2013 by anonymous
I think this is worst case.
Although  k < (x+y+z)
The complexity will be O(x+y+z).
Similar Questions
+3 votes

In an "N" element integer sorted array, a particular elements is repeating "(N/2)+1" times. How much time it take to find the repeating element.

+2 votes

1,1,2,2,2,6,6,6,7,7,7,7,7,7,7,8,8,9,9,9

Example:
Input = 1 Output=0 (First index of 1).
Input = 2 Output=2 (First index of 2).
Input = 6 Output= 5 (First index of 6).
Input = 7 Output= 8 (First index of 7).
Input = 8 Output=15 (First index of 8).
Input = 9 Output=17 (First index of 9).

+1 vote

Given an unsorted array of elements I want to findout the Kth smallest element in the array. Can someone help me with the approach and code.

+1 vote

Find the count k by which array has been rotated in the rotated sorted array. So for example we have sorted array as 2,3,6,12, 15, 18. Now suppose the array is rotated k times ( we don’t know k), such that array becomes 15, 18,2,3,6,12 We have to find K?

...