      "        # TODO: Implement me\n",
      "        pass\n",
      "\n",
      "\n",
      "def insert(root, data):\n",
      "    # TODO: Implement me\n",
      "    pass"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
 
</s> remove     "def insert(root, data):\n",
    "    # Constraint: Assume we are working with valid ints\n",
    "    if root is None:\n",
    "        root = Node(data)\n",
    "        return root\n",
    "    if data <= root.data:\n",
    "        if root.left is None:\n",
    "            root.left = insert(root.left, data)\n",
    "            root.left.parent = root\n",
    "            return root.left\n",
    "        else:\n",
    "            return insert(root.left, data)\n",
    "    else:\n",
    "        if root.right is None:\n",
    "            root.right = insert(root.right, data)\n",
    "            root.right.parent = root\n",
    "            return root.right\n",
 </s> add     "class Bst(object):\n",
    "\n",
    "    def __init__(self, root=None):\n",
    "        self.root = root\n",
    "\n",
    "    def insert(self, data):\n",
    "        if data is None:\n",
    "            raise Exception('Data cannot be None')\n",
    "        if self.root is None:\n",
    "            self.root = Node(data)\n",
    "            return self.root\n",
    "        return self._insert(self.root, data)\n",
    "\n",
    "    def _insert(self, node, data):\n",
    "        # Constraint: Assume we are working with valid ints\n",
    "        if node is None:\n",
    "            return Node(data)\n",
    "        if data <= node.data:\n",
    "            if node.left is None:\n",
    "                node.left = self._insert(node.left, data)\n",
    "                node.left.parent = node\n",
    "                return node.left\n",
    "            else:\n",
    "                return self._insert(node.left, data)\n", </s> remove     "            return insert(root.right, data)"
 </s> add     "            if node.right is None:\n",
    "                node.right = self._insert(node.right, data)\n",
    "                node.right.parent = node\n",
    "                return node.right\n",
    "            else:\n",
    "                return self._insert(node.right, data)" </s> remove     "    test.test_tree()\n",
 </s> add     "    test.test_tree_one()\n",
    "    test.test_tree_two()\n", </s> remove     "    test.test_tree()\n",
 </s> add     "    test.test_tree_one()\n",
    "    test.test_tree_two()\n", </s> remove     "        node = insert(None, 1)\n",
    "        assert_equal(insert(node, 2).data, 2)\n",
    "        assert_equal(insert(node, 3).data, 3)\n",
    "        assert_equal(insert(node, 4).data, 4)\n",
    "        insert(node, 5)\n",
    "        in_order_traversal(node, self.results.add_result)\n",
 </s> add     "    def test_tree_two(self):\n",
    "        bst = Bst()\n",
    "        bst.insert(1)\n",
    "        bst.insert(2)\n",
    "        bst.insert(3)\n",
    "        bst.insert(4)\n",
    "        bst.insert(5)\n",
    "        in_order_traversal(bst.root, self.results.add_result)\n",
    "class Bst(object):\n",
    "\n",
    "    def insert(self, data):\n",
    "        # TODO: Implement me\n",
    "        pass"
      "        # TODO: Implement me\n",
      "        pass\n",
      "\n",
      "\n",
    "class Bst(object):\n",
    "\n",
    "    def insert(self, data):\n",
    "        # TODO: Implement me\n",
    "        pass"
    "class Bst(object):\n",
    "\n",
    "    def insert(self, data):\n",
    "        # TODO: Implement me\n",
    "        pass"
    "class Bst(object):\n",
    "\n",
    "    def insert(self, data):\n",
    "        # TODO: Implement me\n",
    "        pass"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
keep keep keep keep replace replace replace keep keep keep keep keep
 Move bst to a class 
graphs_trees/bst/bst_challenge.ipynb