Skip to content

Commit

Permalink
Merge branch 'cap-paradigmas' of https://github.com/vbuxbaum/projeto-…
Browse files Browse the repository at this point in the history
…algoritmos into cap-paradigmas
  • Loading branch information
vbuxbaum committed Sep 19, 2021
2 parents f84f263 + bbacf37 commit c0846a9
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 c0846a9

Please sign in to comment.