Fix #13, PEP8-ify notebooks.

This commit is contained in:
Donne Martin
2015-07-11 15:34:52 -04:00
parent 374d67ff30
commit 04083b2011
25 changed files with 210 additions and 173 deletions

View File

@@ -1,14 +1,15 @@
class Node(object):
def __init__(self, data, next_node=None):
self.next = next_node
self.data = data
def __str__(self):
return self.data
class LinkedList(object):
def __init__(self, head=None):
self.head = head
@@ -19,7 +20,7 @@ class LinkedList(object):
counter += 1
curr = curr.next
return counter
def insert_to_front(self, data):
if data is None:
return
@@ -30,7 +31,7 @@ class LinkedList(object):
node.next = self.head
self.head = node
return node
def append(self, data, next_node=None):
if data is None:
return
@@ -43,7 +44,7 @@ class LinkedList(object):
curr_node = curr_node.next
curr_node.next = node
return node
def find(self, data):
if data is None:
return
@@ -56,7 +57,7 @@ class LinkedList(object):
else:
curr_node = curr_node.next
return
def delete(self, data):
if data is None:
return