Presentation is loading. Please wait.

Presentation is loading. Please wait.

יסודות מבנה נתונים תרגול 6 Foundations of Data Structures - 2013/Spring, Amihai Savir & Ilya Mirsky AVL TREES.

Similar presentations


Presentation on theme: "יסודות מבנה נתונים תרגול 6 Foundations of Data Structures - 2013/Spring, Amihai Savir & Ilya Mirsky AVL TREES."— Presentation transcript:

1 יסודות מבנה נתונים תרגול 6 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky AVL TREES

2 Trees Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

3 AVL Tree Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

4 Question 1 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky Insert 14, 17, 11, 7, 53, 4, 13 into an empty AVL tree

5 AVL Tree Example:

6 AVL Tree Example: Insert 14, 17, 11, 7, 53, 4, 13 into an empty AVL tree

7 AVL Tree Example: Now insert

8 AVL Tree Example: Now insert

9 AVL Tree Example: Now the AVL tree is balanced

10 AVL Tree Example: Now insert

11 AVL Tree Example: Now insert

12 AVL Tree Example: Now the AVL tree is balanced

13 AVL Tree Example: Now remove

14 AVL Tree Example: Now remove 53, unbalanced

15 AVL Tree Example: Balanced! Remove

16 AVL Tree Example: Remove 11, replace it with the largest in its left branch

17 AVL Tree Example: Remove 8, unbalanced

18 AVL Tree Example: Remove 8, unbalanced

19 AVL Tree Example: Balanced!!

20 Question 2 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

21 Question 2 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

22 Question 2 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

23 Question 2 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

24 Question 3 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

25 Question 4 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

26 Question 4 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

27 Question 4 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

28 Question 4 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

29 Question 4 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

30 Question 5 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

31 Question 5 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

32 Question 5 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

33 Question 5 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky

34 Question 5 Foundations of Data Structures /Spring, Amihai Savir & Ilya Mirsky


Download ppt "יסודות מבנה נתונים תרגול 6 Foundations of Data Structures - 2013/Spring, Amihai Savir & Ilya Mirsky AVL TREES."

Similar presentations


Ads by Google