Kth smallest element of two sorted arrays

Implementation of the algorithm from chapter four: given two sorted
arrays compute the Kth smallest element of the joint array in
logarithmic time.