construct btree from in and post