Highly Influenced

# The nearest colored node in a tree

@article{Gawrychowski2018TheNC, title={The nearest colored node in a tree}, author={Pawel Gawrychowski and Gad M. Landau and Shay Mozes and Oren Weimann}, journal={Theor. Comput. Sci.}, year={2018}, volume={710}, pages={66-73} }

- Published in Theor. Comput. Sci. 2018
DOI:10.1016/j.tcs.2017.08.021

We start a systematic study of data structures for the nearest colored node problem on trees. Given a tree with colored nodes and weighted edges, we want to answer queries (v, c) asking for the nearest node to node v that has color c. This is a natural generalization of the well-known nearest marked ancestor problem. We give an O(n)-space O(log logn)-query solution and show that this is optimal. We also consider the dynamic case where updates can change a node’s color and show that in O(n… CONTINUE READING