Infosys interview question

Programming on nodes reordering in any language