      "\n",
      "\n",
      "def insert(root, data):\n",
      "    if data <= root.data:\n",
      "        if root.left is None:\n",
      "            root.left = Node(data)\n",
      "            root.left.parent = root\n",
      "            return root.left\n",
      "        else:\n",
 
</s> remove     "        node = Node(1)\n",
 </s> add     "        node = insert(None, 1)\n", </s> remove     "        node = Node(1)\n",
 </s> add     "        node = insert(None, 1)\n", </s> remove     "* Time: O(log n)\n",
    "* Space: O(1)"
 </s> add     "* Time: O(h), where h is the height of the tree\n",
    "    * In a balanced tree, the height is O(nlogn)\n",
    "    * In the worst case we have a linked list structure with O(n)\n",
    "* Space: O(m), where m is the recursion depth, or O(1) if using an iterative approach"
    "    if root is None:\n",
    "        root = Node(data)\n",
    "        return root\n",
      "\n",
      "\n",
      "def insert(root, data):\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 = Node(data)\n",
      "            root.left.parent = root\n",
      "            return root.left\n",
      "        else:\n",
keep keep add keep keep keep keep keep keep
 Polish bst challenge and solution

Add root is None input test case.  Update time and space complexity discussion. 
graphs_trees/bst/bst_solution.ipynb