Euler tour (BFS)
(Mylib/Graph/TreeUtils/euler_tour_bfs.cpp)
Operations
EulerTourBFS(tree, int root)
-
query_children(int i, int d, f)
-
query_at(int i, f)
-
query_children(i, 0, f)
と同等。
-
get_parent
-
get_ancestor(int i, int k)
-
i
のk
個遡った祖先を返す。
get_ancestor(i, 0) = i
get_ancestor(i, 1) = get_parent(i)
- Time complexity $O(k)$
Requirements
Notes
Problems
References
Depends on
Verified with
Code
Back to top page