      "collapsed": true
     },
     "outputs": [],
     "source": [
      "# Empty linked list\n",
      "linked_list = MyLinkedList(None)\n",
      "linked_list.remove_dupes()\n",
      "linked_list.print_list()\n",
      "# One element linked list\n",
      "head = Node(2)\n",
      "linked_list = MyLinkedList(head)\n",
      "linked_list.remove_dupes()\n",
      "linked_list.print_list()\n",
      "# Multiple elements\n",
      "# One or more duplicates\n",
      "linked_list.insert_to_front(1)\n",
      "linked_list.insert_to_front(3)\n",
      "linked_list.insert_to_front(1)\n",
      "linked_list.insert_to_front(1)\n",
      "linked_list.remove_dupes()\n",
      "linked_list.print_list()\n",
      "# No duplicates\n",
      "linked_list.remove_dupes()\n",
      "linked_list.print_list()"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
 
</s> remove   {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# Empty linked list\n",
    "linked_list = MyLinkedList(None)\n",
    "linked_list.remove_dupes()\n",
    "linked_list.print_list()\n",
    "# One element linked list\n",
    "head = Node(2)\n",
    "linked_list = MyLinkedList(head)\n",
    "linked_list.remove_dupes()\n",
    "linked_list.print_list()\n",
    "# Multiple elements\n",
    "# One or more duplicates\n",
    "linked_list.insert_to_front(1)\n",
    "linked_list.insert_to_front(3)\n",
    "linked_list.insert_to_front(1)\n",
    "linked_list.insert_to_front(1)\n",
    "linked_list.remove_dupes()\n",
    "linked_list.print_list()\n",
    "# No duplicates\n",
    "linked_list.remove_dupes()\n",
    "linked_list.print_list()"
   ]
  },
 </s> add  </s> remove    "outputs": [],
 </s> add    "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Empty list\n",
      "Test: One element list\n",
      "Test: General case, duplicates\n",
      "Test: General case, no duplicates\n",
      "Success: test_remove_dupes\n",
      "\n",
      "Test: Empty list\n",
      "Test: One element list\n",
      "Test: General case, duplicates\n",
      "Test: General case, no duplicates\n",
      "Success: test_remove_dupes\n",
      "\n"
     ]
    }
   ], </s> remove     "collapsed": true
 </s> add     "collapsed": false </s> remove    "execution_count": null,
 </s> add    "execution_count": 4, </s> remove    "execution_count": null,
 </s> add    "execution_count": 1,
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
      "collapsed": true
     },
     "outputs": [],
     "source": [
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_remove_dupes(self, linked_list):\n",
    "        print('Test: Empty list')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [])\n",
    "\n",
    "        print('Test: One element list')\n",
    "        linked_list.insert_to_front(2)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [2])\n",
    "\n",
    "        print('Test: General case, duplicates')\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(3)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.insert_to_front(1)\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "\n",
    "        print('Test: General case, no duplicates')\n",
    "        linked_list.remove_dupes()\n",
    "        assert_equal(linked_list.get_all_data(), [1, 3, 2])\n",
    "        \n",
    "        print('Success: test_remove_dupes\\n')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    linked_list = MyLinkedList(None)\n",
    "    test.test_remove_dupes(linked_list)\n",
    "    linked_list_alt = MyLinkedListAlt(None)\n",
    "    test.test_remove_dupes(linked_list_alt)"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
keep keep keep keep 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
 Reworked notebook: Added more detail to constraints and test cases.  Reworked unit test. 
linked-lists/remove-duplicates.ipynb