28.04.2013 Views

AVL Trees

AVL Trees

AVL Trees

SHOW MORE
SHOW LESS

Transform your PDFs into Flipbooks and boost your revenue!

Leverage SEO-optimized Flipbooks, powerful backlinks, and multimedia content to professionally showcase your products and significantly increase your reach.

<strong>AVL</strong> Tree Definition (§ 9.2)<br />

<strong>AVL</strong> trees are<br />

balanced.<br />

An <strong>AVL</strong> Tree is a<br />

binary search tree<br />

such that for every<br />

internal node v of T,<br />

the heights of the<br />

children of v can<br />

differ by at most 1.<br />

© 2004 Goodrich, Tamassia<br />

2<br />

4<br />

44<br />

3<br />

17 78<br />

1 2<br />

32 50<br />

1<br />

1<br />

48 62<br />

An example of an <strong>AVL</strong> tree where the<br />

heights are shown next to the nodes:<br />

<strong>AVL</strong> <strong>Trees</strong> 2<br />

88<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!