Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

Distance Between Nodes in A Tree

Revision en1, by StrawberryInsha2k, 2020-04-08 09:46:46

In a weighted tree, how to find for some node (u) the distance to another node (v) (answering Q queries effeiciently)? Constraints N <=10^3, Queries <=10^3

Tags #trees, #graph theory


  Rev. Lang. By When Δ Comment
en1 English StrawberryInsha2k 2020-04-08 09:46:46 189 Initial revision (published)