In Class: Week 13


Create a week13 subdirectory in your cs21/class directory:

      % cd 
      % cd cs21/class
      % pwd
        /home/your_user_name/cs21/class
      % mkdir week13       
	
Then, from within your week13 subdirectory copy over some python files from my public directory:
    % cd week13
    % pwd
      /home/your_user_name/cs21/class/week13

    % cp ~newhall/public/cs21/week13/* .
    % ls
		  linkedlist.py
	

We are going to implement several method functions of the LinkedList class and test them as we go.
  1. insertAtHead(val): add a new node at the front of the linke list
  2. __str__: complete this method that will print out the linked list
  3. insertAtTail(val): add a new node to the end of the linked list
  4. findElement(val): find a matching element in the linked list, returns a reference to the Node with a matching data field or None if no matching value exists in the linked list
  5. insertSorted(val): add a new node in sorted order into the linked list. We will use insertion Sort to find the correct insertion spot for the new element
  6. removeFromHead(): remove the first element from the linked list and returns the value of its data field or None if the list is empty
  7. removeFromTail(): remove the last element from the linked list and returns the value of its data field or None if the list is empty