写了个insert
def insert(self,index,item):
previous=None
current=self.head
count=0
temp=Node(item)
if index>self.size():
print "out index"
elif index==0:
temp.setNext(current)
self.head=temp
else:
while index:
index-=1
previous=current
current=current.getNext()
previous.setNext(temp)
temp.setNext(current)