YANDEX Interview Question

Algorithms on graphs and binary trees