      "                prev.next = curr.next\n",
      "            else:\n",
      "                seen_data.add(curr.data)\n",
      "                prev = curr\n",
      "            curr = curr.next\n",
      "            \n",
      "    def insert_to_front(self, data):\n",
      "        if data is None:\n",
      "            return\n",
      "        node = Node(data)\n",
      "        if self.head is None:\n",
      "            self.head = node\n",
      "        else:\n",
      "            node.next = self.head\n",
      "            self.head = node            \n",
      "            \n",
      "    def print_list(self):\n",
      "        curr = self.head\n",
      "        while curr is not None:\n",
      "            print(curr.data)\n",
      "            curr = curr.next\n",
      "            \n",
      "# Empty linked list\n",
      "linked_list = LinkedList(None)\n",
      "linked_list.remove_dupes()\n",
      "linked_list.print_list()\n",
      "# One element linked list\n",
 
</s> remove     "            curr = curr.next\n",
    "                                \n",
    "    def insert_to_front(self, data):\n",
    "        if data is None:\n",
    "            return\n",
    "        node = Node(data)\n",
    "        if self.head is None:\n",
    "            self.head = node\n",
    "        else:\n",
    "            node.next = self.head\n",
    "            self.head = node            \n",
    "            \n",
    "    def print_list(self):\n",
    "        curr = self.head\n",
    "        while curr is not None:\n",
    "            print(curr.data)\n",
    "            curr = curr.next\n",
    "            \n",
 </s> add     "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [ </s> remove     "        return prev.data\n",
    "        \n",
    "    def insert_to_front(self, data):\n",
    "        if data is None:\n",
    "            return\n",
    "        node = Node(data)\n",
    "        if self.head is None:\n",
    "            self.head = node\n",
    "        else:\n",
    "            node.next = self.head\n",
    "            self.head = node\n",
    "            \n",
 </s> add     "        return prev.data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [ </s> remove     "            node.next = next.next\n",
    "\n",
    "        \n",
    "    def insert_to_front(self, data):\n",
    "        if data is None:\n",
    "            return\n",
    "        node = Node(data)\n",
    "        if self.head is None:\n",
    "            self.head = node\n",
    "        else:\n",
    "            node.next = self.head\n",
    "            self.head = node\n",
    "        return node\n",
    "            \n",
    "    def print_list(self):\n",
    "        curr_node = self.head\n",
    "        while curr_node is not None:\n",
    "            print(curr_node.data)\n",
    "            curr_node = curr_node.next"
 </s> add     "            node.next = next.next" </s> remove     "linked_list = LinkedList(None)\n",
 </s> add     "linked_list = MyLinkedList(None)\n", </s> remove     "linked_list = LinkedList(None)\n",
 </s> add     "linked_list = MyLinkedList(None)\n",
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
      "                prev.next = curr.next\n",
      "            else:\n",
      "                seen_data.add(curr.data)\n",
      "                prev = curr\n",
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "            curr = curr.next"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
      "# Empty linked list\n",
      "linked_list = LinkedList(None)\n",
      "linked_list.remove_dupes()\n",
      "linked_list.print_list()\n",
      "# One element linked list\n",
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Refactored linked list class.  Class is now loaded by other notebooks that reference it. 
linked-lists/remove-duplicates.ipynb