Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getChild(self, data):
- if self.__childs.isEmpty() != True:
- nodo_a = self.__childs
- nodo_a.moveHead()
- encontrado=0
- count = 0
- while count < self.__childs.size() and encontrado == 0 :
- count +=1
- if nodo_a.getCurrent().getData() == data : encontrado = 1
- elif nodo_a.getCurrent() == nodo_a.getTail(): return None
- else: nodo_a.moveNext()
- if encontrado == 1: return nodo_a.getCurrent()
- else: return None
- else:
- return None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement