master > master: src py - minor änderungen

This commit is contained in:
RD
2021-11-01 19:58:03 +01:00
parent 15c2c37213
commit 2c23f4c728
11 changed files with 132 additions and 84 deletions

View File

@@ -33,7 +33,7 @@ def postChecks(L: List[int], **_):
# ALGORITHM max sub sum
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@algorithmInfos(name='MaxSubSum (Maximale Teilsumme)', outputnames=('maxSum', 'index_from', 'index_to'), checks=True, metrics=True, preChecks=preChecks, postChecks=postChecks)
@algorithmInfos(name='MaxSubSum (Maximale Teilsumme)', outputnames=['maxSum', 'index_from', 'index_to'], checks=True, metrics=True, preChecks=preChecks, postChecks=postChecks)
def MaxSubSum(L: List[float]) -> Tuple[float, int, int]:
'''
Inputs: L = Liste von Zahlen
@@ -58,7 +58,7 @@ def MaxSubSum(L: List[float]) -> Tuple[float, int, int]:
# ALGORITHM max sub sum (D & C)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@algorithmInfos(name='MaxSubSum (Maximale Teilsumme mit D & C)', outputnames=('maxSum', 'index_from', 'index_to'), checks=True, metrics=True, preChecks=preChecks, postChecks=postChecks)
@algorithmInfos(name='MaxSubSum (Maximale Teilsumme mit D & C)', outputnames=['maxSum', 'index_from', 'index_to'], checks=True, metrics=True, preChecks=preChecks, postChecks=postChecks)
def MaxSubSumDC(L: List[float]) -> Tuple[float, int, int]:
'''
Inputs: L = Liste von Zahlen
@@ -127,7 +127,7 @@ def lRandSum(L: List[float]) -> Tuple[float, int, int]:
'''
n = len(L);
## berechne kumulative Summen (vorwärts)
AddToCounter(n);
AddTimeCost(n);
total = L[0];
maxSum = total;
u = 0;
@@ -148,7 +148,7 @@ def rRandSum(L: List[float]) -> Tuple[float, int, int]:
'''
n = len(L);
## berechne kumulative Summen (rückwärts)
AddToCounter(n);
AddTimeCost(n);
total = L[n-1];
maxSum = total;
u = n-1;