python data structures binary search tree (bstis treein which all the nodes follow the below-mentioned properties the left sub-tree of node has key less than or equal to its parent node' key the right sub-tree of node has key greater than to its parent node' key thusbst divides all its sub-trees into two segmentsthe left sub-tree and the right sub-tree left_subtree (keys<node (key<right_subtree (keyssearch for value in -tree searching for value in tree involves comparing the incoming value with the value exiting nodes here alsowe traverse the nodes from left to right and then finallywith the parent if the searched for value does not match any of the existing valuethen we return not found messageor else the found message is returned class nodedef __init__(selfdata)self left none self right none self data data insert method to create nodes def insert(selfdata)if self dataif data self dataif self left is noneself left node(dataelseself left insert(dataelif data self dataif self right is noneself right node(dataelseself right insert(data