Balik trid pro tridy urcene pro algoritmy typu BFS.