In this tutorial we will learn about Binary Search Tree and its operations with some examples.
What is Binary Search Tree?
BST is node-based binary data structure which has the following properties:
- Left subtree nodes always be less than the root node.
- Right subtree nodes always be greater than the root node.
- Left and right subtrees also BST without any duplicate nodes.
- By default there is no duplicate.
Operations in Binary Search Tree
- Creating Binary Search Tree.
- BST Traversal. (Inorder, Preorder, Postorder)
- Search in BST.
- Deletion in BST
- Print a Range.
- Root to Leaf Node.
Standard BST Problems
Some of the standard and basic problems are below which are generally asked in the past interviews.
- Find a value in BST.
- Delete a node in BST.
- Find minimum and maximum value in BST.
- Check is tree is BST or not.
- Convert Binary Tree into BST
- Find LCA of 2 nodes in BST.
- Merge 2 BST.
- Find kth largest element in BST
- Find kth smallest element in BST.
- Find the medial of the BST.
Thank you for reaching out this tutorial. You can learn more about it from here.
Post your Content Free
You can post your content here free; we will review it then will post on FlutterTPoint.