mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-28 18:41:38 +08:00
10 lines
811 B
HTML
10 lines
811 B
HTML
<!DOCTYPE html>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||
<h1>1066. Root of AVL Tree (25)</h1>
|
||
<div id="problemContent">
|
||
<p>An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4 illustrate the rotation rules.</p>
|
||
<center><img src="http://nos.patest.cn/79_mtxjq1kj3gx.jpg"/> <img src="http://nos.patest.cn/79_mtxjqnwja2o.jpg"/></center>
|
||
<p></p>
|
||
<center><img src="http://nos.patest.cn/79_mtxjr4gyzdg.jpg"/> <img src="http://nos.patest.cn/79_mtxjrh51o9y.jpg"/></center>
|
||
<p>Now given a sequence of insertions, you are supposed to tell the root of the resulting AVL tree.</p>
|
||
</div> |