Yandex Interview Question

Revert a binary tree in a set amount of time.