Kth smallest element in 2 sorted arrays and linked list to binary tree