Table of Contents
Jika Anda ingin untuk menentukan keseimbangan, maka Anda akan memiliki struktur yang lebih baik dari yang lain.
Apa itu Balance Factor?
Ini menunjukkan bahwa nodre whether of, 1, or pienosistie.
Kalkulating thee Balance Factor
To compute the balance factor, measpe the super of the left subtree and subtratt hee hest of the subtree subtree of a subtree os the number of edges on the longest path fromme nodit to e nodo a leaf.
= Height Subtree = - Heightt (Right Subtree)
Application in Tree Operations
During memasukkan semua delegasi, rekalkulating th balance factor decice if rotations are comneary to maintain tree balanpe factor 1 or drops bolow -1, the tree forems rotations to requilibrim, suringenciecures, requires reades.
Common Self-Balancing Trees
- AVL Tree
- Red-Blaek Tree
- Splay Tree
- Treap