     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
     "outputs": [],
     "source": [
      "%%writefile linked_list.py\n",
      "\n",
      "class Node(object):\n",
      "    def __init__(self, data, next_node=None):\n",
 
</s> remove     "            curr_node = curr_node.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%run linked_list.py"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Test insert_to_front\n",
    "# Insert in an empty list\n",
    "linked_list = LinkedList(None)\n",
    "linked_list.insert_to_front(10)\n",
    "linked_list.print_list()\n",
    "# Insert a NULL\n",
    "linked_list.insert_to_front(None)\n",
    "linked_list.print_list()\n",
    "# Insert in a list with one element or more elements\n",
    "linked_list.insert_to_front('a')\n",
    "linked_list.insert_to_front('bc')\n",
    "linked_list.print_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Test append\n",
    "# Insert in an empty list\n",
    "linked_list = LinkedList(None)\n",
    "linked_list.append(10)\n",
    "linked_list.print_list()\n",
    "# Insert a NULL\n",
    "linked_list.append(None)\n",
    "linked_list.print_list()\n",
    "# Insert in a list with one element or more elements\n",
    "linked_list.append('a')\n",
    "linked_list.append('bc')\n",
    "linked_list.print_list()"
 </s> add     "            curr_node = curr_node.next\n",
    "\n",
    "    def get_all_data(self):\n",
    "        data = []\n",
    "        curr_node = self.head\n",
    "        while curr_node is not None:\n",
    "            data.append(curr_node.data)\n",
    "            curr_node = curr_node.next\n",
    "        return data" </s> remove    "execution_count": null,
 </s> add    "execution_count": 1, </s> remove    "execution_count": null,
 </s> add    "execution_count": 3, </s> remove    "execution_count": null,
 </s> add    "execution_count": 2, </s> remove    "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
 </s> add    "cell_type": "markdown",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting linked_list.py\n"
     ]
    }
   ],
     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting linked_list.py\n"
     ]
    }
   ],
     "source": [
      "%%writefile linked_list.py\n",
      "\n",
      "class Node(object):\n",
      "    def __init__(self, data, next_node=None):\n",
keep keep keep keep replace keep keep keep keep keep
 Reworked notebook: Added more detail to constraints and test cases.  Reworked algorithm discussion, code, and unit test. 
linked-lists/linked-list.ipynb