GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javascript-algorithms/src/data-structures/tree/avl-tree at master · BrandonWeb/javascript-algorithms

Expand file tree

/

avl-tree

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

avl-tree

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
__test__
__test__
 
 
AvlTree.js
AvlTree.js
 
 
README.md
README.md
 
 

README.md

Outline

AVL Tree

In computer science, an AVL tree (named after inventors Adelson-Velsky and Landis) is a self-balancing binary search tree. It was the first such data structure to be invented. 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. Lookup, insertion, and deletion all take O(log n) time in both the average and worst cases, where n is the number of nodes in the tree prior to the operation. Insertions and deletions may require the tree to be rebalanced by one or more tree rotations.

Animation showing the insertion of several elements into an AVL tree. It includes left, right, left-right and right-left rotations.

AVL Tree

AVL tree with balance factors (green)

AVL Tree

AVL Tree Rotations

Left-Left Rotation

Left-Left Rotation

Right-Right Rotation

Right-Right Rotation

Left-Right Rotation

Left-Right Rotation

Right-Left Rotation

Right-Right Rotation

References

  • Wikipedia
  • Tutorials Point
  • BTech
  • AVL Tree Insertion on YouTube
  • AVL Tree Interactive Visualisations
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.