So I've been using C for almost a year now but decided to give Python a chance. Python and many high level languages don't have pointers like C. Without pointers how do you implement dynamic data structures like lists and trees? (I know that Python has these built in but what if I want to use a more specific structure not built in)
Name:
Anonymous2011-08-19 9:13
class LinkedList:
class Node:
def __init__(self, elem):
self.elem = elem
self.next = None
class Iterator:
def __init__(self, node):
self.current = node
def next(self):
if self.current.next == None:
raise StopIteration