eBay interview question

tree data structure operation. valid parathesis.