I got an interview question asking for data structure and algorithm. The question is: Given we have unlimited space, We need to insert a key in $O(logn)$ and find a median in $O(logn)$. Min heap/ Max heap are good candidates to insert a key in $O(logn)$ but sorting requires $O(nlogn)$. How can we design a data structure so that it can find a median in $O(logn)$? The hint given by the interviewer is confused to me, the interviewer said we need two heaps. How can two heaps work?