Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
class Node(object):
|
||||
def __init__(self, data = None, prev = None, next = None):
|
||||
self.prev = prev
|
||||
self.next = next
|
||||
self.data = data
|
||||
def __str__(self):
|
||||
return str(self.data)
|
||||
def __repr__(self):
|
||||
return repr(self.data)
|
||||
def iter_forward(self):
|
||||
c = self
|
||||
while c != None:
|
||||
yield c
|
||||
c = c.next
|
||||
def iter_backward(self):
|
||||
c = self
|
||||
while c != None:
|
||||
yield c
|
||||
c = c.prev
|
||||
Loading…
Add table
Add a link
Reference in a new issue