# coding:utf-8 import numpy as np import matplotlib.pyplot as plt T = [[2, 3], [5, 4], [9, 6], [4, 7], [8, 1], [7, 2]] S=[7, 3] class node: def __init__(self, point): self.left = None self.right = None self.point = point self.parent = None pass def s…