Implemented sorting of keys in tree in alternative order.