title: K-th element in a heap tree
body: <p>I have a heap (implemented like a binary tree: each node has two pointers to the children and one pointer to the parent).</p>
  
  <p>How can I find the k-th element (in a BFS order), given the number of elements in it? I think it can be done in O(logn) time..</p>