Linked List Assignment

Your mission is to define a LinkedList class so that you can:

>>> list1 = LinkedList()
>>> list1
[]
>>> list.length()
0
>>> list1.append(23)
>>> list1
[23]
>>> list1.get(0)
23
>>> list1.append(100)
>>> list1.get(1)
100
>>> list1.append(78)
>>> list1.append(15)
>>> list1
[23, 100, 78, 15]
>>> list.length()
4
>>> list1.remove(1) # removes 2nd item
100
>>> list1
>>> [23, 78, 15]
>>> list.length()
3

The only constraint is that you can't use a Python list.

You may work in teams of two for this assignment. Each team should turn it:

  1. A hardcopy of your code
  2. A printout of you showing your code working
  3. Answer the questions: how does the number of elements in a list affect computing the length of the list? Test this by adding a large number of items to your list. Does it it take longer?

Bonus:

Make your code so that you can delete the first item in a list:

>>> list1 = LinkedList()
>>> list1.append(23)
>>> list1.append(100)
>>> list1.append(78)
>>> list1.append(15)
>>> list1
[23, 100, 78, 15]
>>> list.remove(0)
23
>>> list1
[100, 78, 15]