

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Binary search tree also known as BST is a special kind of binary tree that is efficient to organize data for quick search. It is a collection of nodes with edges that connect them. The nodes are organized in two levels. The top-level is called the root node. Each node can have a parent node and a child node. All the nodes of the left sub-tree must be lesser than the root node and the value of all the nodes in the right sub-tree must be greater than the root node. Each node can have at most two children. Nodes which don’t have any child is called leaf node. In BST, node’s left child must have value less than its parent value and node’s right child must have value greater than its parent value. Root Edge Parent Child Leaf
Tree is not a linear data structure like an array or a linked list therefore; it can be traversed in many ways. We broadly classify traversal into two ways: The breadth first traversal The depth first traversal. These techniques are general ways of traversing. The breadth first traversal: It is also known as level order traversal. It refers to traversing the tree nodes in a level by level fashion. Let’s see it with example.
Depth first traversal has further categories. It can be preorder traversal, post order traversal and inorder traversal.
store very large data efficiently. It is very suitable tool that allow database to respond number of different kind of queries to be answered rapidly. Designers used the concept of b-tree in database to retrieve the records from the disk to the database. Use of B+ tree in database: B+ tree used to store very large database and it is very similar to b-tree. The only difference of b+ tree is that the leaf nodes denotes actual pointer. All leaf nodes remain at same height and they are linked using linked list. The internal nodes just store keys. Data records are only stored in leaf nodes that’s why we b+ tree is used instead of b-tree. It also occupies more space than b-tree.