Skip to content

Commit

Permalink
Torna métodos protegidos
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuxbaum authored Sep 16, 2021
1 parent ec70dda commit bbacf37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions 2_paradigmas/07_max_min_recursivo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ def max_min(cls, numeros):
metade = len(numeros) // 2
check_head = cls.max_min(numeros[:metade])
check_tail = cls.max_min(numeros[metade:])
resultado_max_min["max"] = cls.decide_max(check_head, check_tail)
resultado_max_min["min"] = cls.decide_min(check_head, check_tail)
resultado_max_min["max"] = cls._decide_max(check_head, check_tail)
resultado_max_min["min"] = cls._decide_min(check_head, check_tail)
return resultado_max_min

@classmethod
def decide_max(cls, head, tail):
def _decide_max(cls, head, tail):
return head["max"] if head["max"] > tail["max"] else tail["max"]

@classmethod
def decide_min(cls, head, tail):
def _decide_min(cls, head, tail):
return head["min"] if head["min"] < tail["min"] else tail["min"]


Expand Down

0 comments on commit bbacf37

Please sign in to comment.