Amazon interview question

LP's and LC med (binary tree)