Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1.         def getChild(self, data):
  2.            
  3.             if self.__childs.isEmpty() != True:
  4.                 nodo_a = self.__childs
  5.                 nodo_a.moveHead()
  6.                 encontrado=0
  7.                 count = 0
  8.            
  9.                 while count < self.__childs.size() and encontrado == 0 :
  10.                     count +=1
  11.                    
  12.                     if nodo_a.getCurrent().getData() == data :  encontrado = 1
  13.                     elif nodo_a.getCurrent() == nodo_a.getTail(): return None
  14.                     else:   nodo_a.moveNext()
  15.                
  16.                 if encontrado == 1: return nodo_a.getCurrent()  
  17.                 else:   return None
  18.                
  19.             else:
  20.                 return None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement