Exemplo n.º 1
0
 def getValues(self):
     result = SinglyLinkedList()
     # the result will be a list with all the values
     for element in self.buckets:
         if element is not None and element.isStatus() is True:
             result.add(element.getValue())
     return result
Exemplo n.º 2
0
 def getValues(self):
     # The method returns a list with all the values
     result = SinglyLinkedList()
     for lists in self.buckets:
         if lists is not None:
             tempIndex = 0
             while tempIndex < lists.size():
                 element = lists.get(tempIndex)
                 if element is not None and element.isStatus() is True:
                     result.add(element.getValue())
                 tempIndex += 1
     return result