Bloomberg interview question

Look ahead search for sorting words Verifying a complete binary tree