Блог пользователя mayankp

Автор mayankp, история, 7 лет назад, По-английски

How does one make a link-cut tree support finding the maximum (or anything else of the sort) along the edges of a vertex to the root? All implementations I have seen only support finding aggregates of vertices along such paths, and I think that simply having each vertex store the value of the edge from it to its parent doesn't work well when one links vertices which changes the parents of a bunch of vertices.

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by mayankp (previous revision, new revision, compare).

»
7 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

The trick is to treat edges as vertices : an edge (u,v) in your forest is represented by two edges in the link-cut tree : (u,e) and (e,v), with the edge information associated to the node e.