Extremal properties of graphs and eigencentrality in trees with a given degree sequence