# 思路1 dfs 剥洋葱

这个图是一个多叉树

为了使生成的树的高度最小,root 节点必须是尽可能接近中心的

如何找出中心节点?

* 如果将最外层叶子节点砍掉,就会有新的一层叶子节点出现,这样一直砍下去直到最后一层就是中心节点.

当前最外层叶子结点的度为1

最后的结果必然是一个或两个节点


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://851958789.gitbook.io/notes/0310_minimum_height_trees/slt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
