Oracle interview question

Bst problem. Dp problem and general tech