Help needed in SORTING LT03

Help needed in August Lunch Time 03 problem SORTING. I went through the Editorial and the link given by mugurelionut in the same editorial ,but still unable to understand many things. It will be very helpfull if someone will explain it with a small example along with the structure of the Tree…Thankyou…Problem Link :