notesonly.in

One notebook for every subject — open it anywhere.

Log in

Trees: binary trees, BST, AVL trees, B-trees

Data Structures · Engineering

Study notes

Insert 10, 5, 15, 3 into a BST: 10 root, 5 left, 15 right, 3 left of 5. Search 3: compare 10, go left; compare 5, go left; found in 3 steps. Inorder traversal gives sorted order: 3, 5, 10, 15. Inserting sorted data 1,2,3,4 degenerates to a chain; AVL rotations fix this.

← Back to topics for Engineering