What is Binary Search Tree Last Updated : 01 Mar, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report A binary search tree (BST) is a binary tree in which the left subtree of a node contains only nodes with less value and the right subtree of a node contains only nodes with values greater than it. Binary Search TreeCharacteristics of Binary Search Tree: The properties of a binary search tree are as follows: Ordering property: Every node in a binary search tree has a value, and the values in the left subtree are less than the value of the node, while the values in the right subtree are greater than the value of the node.Recursive structure: A binary search tree is a recursive data structure because each subtree of a binary search tree is also a binary search tree.Traversal order: The in-order traversal of a binary search tree gives the keys in sorted order.Applications of Binary Search Tree:Searching: As the name suggests, binary search trees are primarily used for searching operations. Due to their ordering property, they can be used to quickly search for a particular key or value.Sorting: Binary search trees can be used to sort a list of items in O(N * logN) time. The inorder traversal of the tree produces the items in sorted order.Symbol tables: Symbol tables are data structures used to store key-value pairs. Binary search trees can be used to implement symbol tables with efficient search, insert, and delete operations.Indexing: BSTs are used for indexing in databases. For more applications of BST refer to this article. Advantages of Binary Search Tree:Fast search: Binary search trees provide efficient search operations with an average time complexity of O(log n) for a tree with n nodes. This makes them ideal for applications that require fast searching.Sorting: Binary search trees can be used to sort a list of items in O(n log n) time, which is faster than many other sorting algorithms..Dynamic resizing: Binary search trees can be easily resized by inserting or deleting nodes, which makes them suitable for applications that require dynamic resizing.Efficient memory usage: Binary search trees use memory efficiently by only storing the data required for each node, which makes them ideal for applications with limited memory. For more advantages refer to this article. Disadvantages of Binary Search Tree: The disadvantages of binary search trees are as follows: Unbalanced Trees: If the binary search tree is unbalanced, with one subtree much larger than the other, it can lead to slow search and insertion times. Unbalanced trees can also lead to higher memory usage.Degenerate Trees: A degenerate tree is a tree where each parent node has only one child. In this case, the binary search tree becomes a linked list, which can result in slow search and insertion times.Difficulty of Deletion: Deleting a node in a binary search tree can be complex, especially when the node has two children. In this case, the tree must be restructured to maintain the ordering property.Not thread-safe: Binary search trees are not inherently thread-safe, and concurrent access to the tree can lead to race conditions and other concurrency issues.Performance depends on the data: The performance of binary search trees depends on the structure of the data being stored. In some cases, other data structures may be more suitable for the data being stored. For more disadvantages, refer to this article. What else can you read?Introduction to Binary Search Tree - Data Structure and Algorithm TutorialsApplications of BSTSearching and Insertion in Binary Search Tree Comment More infoAdvertise with us Next Article What is Binary Tree? I ianurag Follow Improve Article Tags : Tree DSA Definitions and Meanings Binary Search Trees Practice Tags : Tree Similar Reads What is Binary Tree? A binary tree is a type of tree data structure in which each node can have at most two child nodes, known as the left child and the right child. Each node of the tree consists of - data and pointers to the left and the right child. Example of Binary TreeProperties of a Binary Tree: The following are 3 min read Binary Search Tree A Binary Search Tree (BST) is a type of binary tree data structure in which each node contains a unique key and satisfies a specific ordering property:All nodes in the left subtree of a node contain values strictly less than the nodeâs value. All nodes in the right subtree of a node contain values s 4 min read Binary Search Tree In Python A Binary search tree is a binary tree where the values of the left sub-tree are less than the root node and the values of the right sub-tree are greater than the value of the root node. In this article, we will discuss the binary search tree in Python.What is a Binary Search Tree(BST)?A Binary Searc 11 min read What is Binary Search Algorithm? Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search interval in half and the correct interval to find is decided based on the searched value and the mid value of the interval. Example of binary searchProperties of Binary Search:Binary search is performed o 1 min read Search a node in Binary Tree Given a Binary tree and a key. The task is to search and check if the given key exists in the binary tree or not.Examples:Input: Output: TrueInput: Output: FalseApproach:The idea is to use any of the tree traversals to traverse the tree and while traversing check if the current node matches with the 7 min read Double Threaded Binary Search Tree Double Threaded Binary Search Tree: is a binary search tree in which the nodes are not every left NULL pointer points to its inorder predecessor and the right NULL pointer points to the inorder successor.The threads are also useful for fast accessing the ancestors of a node. Â Double Threaded Binary 15+ min read Like