insertions when binary search tree is constructedthe keys are added one at time as the keys are inserteda new node is created for each key and linked into its proper position within the tree suppose we want to build binary search tree from the key list [ by inserting the keys in the order they are listed figure illustrates the steps in building the treewhich you can follow as we describe the process (ainsert (binsert (dinsert (cinsert (einsert (finsert figure building binary tree by inserting the keys [ we start by inserting value node is created and its data field set to that value since the tree is initially emptythis first node becomes the root of the tree (part anextwe insert value since it is smaller than it has to be inserted to the left of the rootwhich means it becomes the left child of the root (part bvalue is then inserted in node linked as the right child of the root since it is larger than (part cwhat happens when value is insertedthe root already has both its left and right children when new keys are insertedwe do not modify the data fields of existing nodes or the links between existing nodes thusthere is only one location in which key value can be inserted into our current tree and still maintain the search tree property it has to be inserted as the right child of node (part dyou may have noticed the pattern that is forming as new nodes are added to the binary tree the new nodes are always inserted as leaf node in its proper position such that the binary search tree property is maintained we conclude this example by inserting the last two keys and into the tree (parts and fworking through this example by handit was easy to see where each new node had to be linked into the tree but how do we insert the new keys in program codesuppose we want to insert key into the tree we built by hand what happens if we use the bstsearch(method and search for key the search will lead us to node and we then fall off the tree when attempting to follow its left child