1 / 39

AVL Tree In Data Structure | What Is AVL Tree In Data Structure | Data Structure

This presentation is based on the AVL tree in Data Structure. This tutorial explains what is an AVL tree in data structure and will help beginners with the fundamentals of Data structure. The video also covers practical demo for a better learning experience.<br>

Simplilearn
Download Presentation

AVL Tree In Data Structure | What Is AVL Tree In Data Structure | Data Structure

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AVL Tree in Data Structures

  2. Agenda AVL Tree

  3. Agenda AVL Tree What is AVL Tree?

  4. AVL Tree in Data Structures Click here to watch the video

  5. Agenda Rotations in AVL Tree What is AVL Tree? AVL Tree

  6. Agenda Rotations in AVL Tree Complexity What is AVL Tree? AVL Tree

  7. Agenda Rotations in AVL Tree Complexity What is AVL Tree? AVL Tree Operations

  8. Agenda Rotations in AVL Tree Complexity What is AVL Tree? AVL Tree Operations Conclusion

  9. What is a AVL Tree

  10. What is a AVL Tree? • A AVL tree is a height balanced binary search tree in which height of left sub tree and right subtree can differ at most by one. • Balance factor(x) = | height(left(x)) – height(right(x)) |

  11. Rotations in AVL Trees

  12. Rotations in Binary Trees • We can perform Four type of Rotations on a AVL Tree • LL Rotation • RR Rotation • LR Rotation • RL Rotation

  13. Rotations in Binary Trees LL Rotation

  14. Rotations in Binary Trees LL Rotation

  15. Rotations in Binary Trees RR Rotation

  16. Rotations in Binary Trees RR Rotation

  17. Rotations in Binary Trees • LR Rotation • LR=RR+LL

  18. Rotations in Binary Trees • LR Rotation • LR=RR+LL

  19. Rotations in Binary Trees • LR Rotation • LR=RR+LL

  20. Rotations in Binary Trees • RL Rotation • RL=LL+RR

  21. Rotations in Binary Trees • RL Rotation • RL=LL+RR

  22. Rotations in Binary Trees • RL Rotation • RL=LL+RR

  23. Complexity

  24. Complexity Space Complexity of AVL trees = O(n) Search Complexity of AVL Trees = O(log n) insertion Complexity of AVL Trees = O(log n) Deletion Complexity of AVL Trees = O(log n)

  25. Operations

  26. Operations Insertion Deletion

  27. Operations Insertion Deletion

  28. Operations Insertion Deletion

  29. Insertion

  30. Insertion

  31. Insertion

  32. Deletion

  33. Deletion

  34. Deletion

  35. Deletion

  36. Conclusion

  37. Conclusion AVL Tree is a self balancing Binary search tree. Balance factor of each node must be either -1, 0 or 1. After every step, We need to verify its balance factor. It is faster at insertion and deletion operation.

More Related