      "    def test_bst_successor(self):\n",
      "        nodes = {}\n",
      "        node = Node(5)\n",
      "        nodes[5] = node\n",
      "        nodes[3] = insert(node, 3)\n",
      "        nodes[8] = insert(node, 8)\n",
      "        nodes[2] = insert(node, 2)\n",
      "        nodes[4] = insert(node, 4)\n",
      "        nodes[6] = insert(node, 6)\n",
      "        nodes[12] = insert(node, 12)\n",
      "        nodes[1] = insert(node, 1)\n",
      "        nodes[7] = insert(node, 7)\n",
      "        nodes[10] = insert(node, 10)\n",
      "        nodes[15] = insert(node, 15)\n",
      "        nodes[9] = insert(node, 9)\n",
      "\n",
      "        assert_equal(bst_successor(nodes[4]), 5)\n",
      "        assert_equal(bst_successor(nodes[5]), 6)\n",
      "        assert_equal(bst_successor(nodes[8]), 9)\n",
      "        assert_equal(bst_successor(nodes[15]), None)\n",
      "\n",
      "        print('Success: test_bst_successor')\n",
      "\n",
      "\n",
      "def main():\n",
 
</s>
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
      "    def test_bst_successor(self):\n",
      "        nodes = {}\n",
      "        node = Node(5)\n",
      "        nodes[5] = node\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
    "        bst = Bst(nodes[5])\n",
    "        nodes[3] = bst.insert(3)\n",
    "        nodes[8] = bst.insert(8)\n",
    "        nodes[2] = bst.insert(2)\n",
    "        nodes[4] = bst.insert(4)\n",
    "        nodes[6] = bst.insert(6)\n",
    "        nodes[12] = bst.insert(12)\n",
    "        nodes[1] = bst.insert(1)\n",
    "        nodes[7] = bst.insert(7)\n",
    "        nodes[10] = bst.insert(10)\n",
    "        nodes[15] = bst.insert(15)\n",
    "        nodes[9] = bst.insert(9)\n",
    "\n",
    "        bst_successor = BstSuccessor()\n",
    "        assert_equal(bst_successor.get_next(nodes[4]), 5)\n",
    "        assert_equal(bst_successor.get_next(nodes[5]), 6)\n",
    "        assert_equal(bst_successor.get_next(nodes[8]), 9)\n",
    "        assert_equal(bst_successor.get_next(nodes[15]), None)\n",
      "\n",
      "        print('Success: test_bst_successor')\n",
      "\n",
      "\n",
      "def main():\n",
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Move bst successor to a class
graphs_trees/bst_successor/bst_successor_solution.ipynb