#coding:utf-8 class node(): def __init__(self,k=None,l=None,r=None): self.key=k; self.left=l; self.right=r; def create(root): a=input('enter a key:'); if a is '#': root=None; else: root=node(k=a); root.left=create(root.left); root.right=create(root.r…