SAP interview question

build bt from sorted array