CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 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