Implementation of binary search trees
Since a binary search tree is just one that follows some special properties, its structure is the same as any other binary tree. We know that a binary tree can be represented using arrays and linked structures, so a binary search tree can also be represented using any of those.
However, binary search trees are more commonly represented and stored as linked data structures rather than arrays.
Why are binary search trees stored and represented as linked structures?
Binary search trees are typically represented and stored as linked structures because we rarely need to go upwards in a binary search tree during any operation. Representing and storing binary search trees as a linked data structure allows us to dynamically increase or decrease the size.
Liking the course? Check our discounted plans to continue learning.