Files
PAT/html/a1066.html
T

10 lines
811 B
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!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>