     "execution_count": 2,
     "metadata": {
      "collapsed": false
     },
     "outputs": [
      {
       "name": "stdout",
       "output_type": "stream",
       "text": [
        "Overwriting height.py\n"
       ]
      }
     ],
     "source": [
      "%%writefile height.py\n",
      "def height(node):\n",
      "    if node is None:\n",
      "        return 0\n",
      "    return 1 + max(height(node.left), \n",
      "                   height(node.right))"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 3,
     "metadata": {
      "collapsed": true
     },
     "outputs": [],
     "source": [
      "%run height.py"
     ]
    },
 
</s> remove     "%run height.py"
 </s> add     "class BstHeight(Bst):\n",
    "\n",
    "    def height(self, node):\n",
    "        if node is None:\n",
    "            return 0\n",
    "        return 1 + max(self.height(node.left),\n",
    "                       self.height(node.right))" </s> remove    "execution_count": 4,
 </s> add    "execution_count": 3, </s> remove    "execution_count": 5,
 </s> add    "execution_count": 4, </s> remove     "def height(node):\n",
    "    # TODO: Implement me\n",
    "    pass"
 </s> add     "class BstHeight(Bst):\n",
    "\n",
    "    def height(self, node):\n",
    "        # TODO: Implement me\n",
    "        pass" </s> remove def height(node):
    if node is None:
        return 0
    return 1 + max(height(node.left), 
                   height(node.right)) </s> add 
     "execution_count": 2,
     "metadata": {
      "collapsed": false
     },
























     "outputs": [],
     "source": [
      "%run height.py"
     ]
    },
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Move tree height to a class 
graphs_trees/tree_height/height_solution.ipynb