binary trees the method of solution involves the development of theory of finite automata operating on infinite trees -"decidability of second order theories and automata on trees, rabin formallya binary tree is either emptyor root node together with left binary tree and right binary tree the subtrees themselves are binary trees the left binary tree is sometimes referred to as the left subtree of the rootand the right binary tree is referred to as the right subtree of the root binary trees most commonly occur in the context of binary search treeswherein keys are stored in sorted fashion on page howeverthere are many other applications of binary treesat high levelbinary tree are appropriate when dealing with hierarchies figure gives graphical representation of binary tree node is the root nodes and are the left and right children of depth depth depth height depth depth depth figure example of binary tree the node depths range from to node has the highest depth ( of any node in the treeimplying the height of the tree is often the node stores additional data its prototype is listed as followsclass binarytreenode def __init__ (self data=none left=none right =none)self data data self left left self right right