A Binary Search Tree is a type of binary tree with these key rules:
markdown
CopyEdit
8
/ \
3 10
/ \ \
1 6 14
/ \ /
4 7 13
< 8> 8BST is used for fast search, insert, and delete operations.
| Operation | Time (Average Case) | Time (Worst Case – Skewed Tree) |
|---|---|---|
| Search | O(log n) | O(n) |
| Insert | O(log n) | O(n) |
| Delete | O(log n) | O(n) |
In balanced BSTs (like AVL or Red-Black Tree), operations are guaranteed O(log n).
An ordered set is a data structure that: