0

I'm reading about AVL tree and there I redirected to self balancing tree there I read that

In computer science, a self-balancing (or height-balanced) binary search tree is any node-based binary search tree that automatically keeps its height (maximal number of levels below the root) small in the face of arbitrary item insertions and deletions.1

These structures provide efficient implementations for mutable ordered lists, and can be used for other abstract data structures such as associative arrays, priority queues and sets.

I'm confused

  1. What is the relation of height to list? array?
  2. how small height tree provide efficient implementations for mutable ordered lists? array? queues?
  3. Let suppose the node of list or index of array are height of list or array, how it could be small?
Asif Mushtaq
  • 3,658
  • 4
  • 44
  • 80

1 Answers1

0

Here is a visual on balance Here is what it looks like in the Java library (via my computer science professor 2. Remember that trees offer a unique path to every node. Because AVL trees are binary search trees we "know" which direction to go when given a value, because the tree is sorted. AVL trees (for every node, the heights of the left and right subtrees differ by at most 1) allow for quick searches and insertions, usually log N, because it can rotate and manipulate itself in constant time. We can implement an ordered list, queue, etc. values into a tree structure to leverage its characteristics. The key is the tree remaining balanced (stays horizontal not vertical, which it does by following the binary search tree trait).

Can you elaborate on 1 and 3?