master > master: code - minor
This commit is contained in:
parent
6541a5246d
commit
18ece75b67
@ -21,7 +21,7 @@ import (
|
||||
* ---------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
Inputs: L = Liste von Zahlen, x = Zahl.
|
||||
Inputs: L = Liste von Zahlen.
|
||||
|
||||
Outputs: Liste von Paaren von Elementen und ihrem nächsten größeren Element
|
||||
*/
|
||||
@ -42,7 +42,7 @@ func NextGreaterElement(L []int) [][2]int {
|
||||
element := S.TOP()
|
||||
if element < nextElement {
|
||||
// falls top Element < next Element, zum Output hinzufügen und vom Stack entfernen
|
||||
logging.Debug("Stack S | %v; top Element > nextElement; ==> pop und Paar zum Output hinzufügen", S)
|
||||
logging.Debug("Stack S | %v; top Element < nextElement; ==> pop und Paar zum Output hinzufügen", S)
|
||||
output = append(output, [2]int{element, nextElement})
|
||||
S.POP()
|
||||
metrics.AddMovesCost()
|
||||
|
@ -24,7 +24,7 @@ type QueueInt struct {
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- *
|
||||
* METHODS stacks
|
||||
* METHODS queues
|
||||
* ---------------------------------------------------------------- */
|
||||
|
||||
func CREATE() QueueInt {
|
||||
|
@ -37,7 +37,7 @@ def postChecks(L: List[int], **_):
|
||||
@algorithmInfos(name='NextGreaterElement (with stacks)', outputnames=['pairs'], preChecks=preChecks, postChecks=postChecks)
|
||||
def NextGreaterElement(L: List[int]) -> List[Tuple[int,int]]:
|
||||
'''
|
||||
Inputs: L = Liste von Zahlen, x = Zahl.
|
||||
Inputs: L = Liste von Zahlen.
|
||||
Outputs: Liste von Paaren von Elementen und ihrem nächsten größeren Element
|
||||
'''
|
||||
output = [];
|
||||
@ -57,7 +57,7 @@ def NextGreaterElement(L: List[int]) -> List[Tuple[int,int]]:
|
||||
element = S.TOP();
|
||||
# falls element < next Element, zum Output hinzufügen und vom Stack entfernen
|
||||
if element < nextElement:
|
||||
logDebug('Stack S | {S}; top Element > nextElement; ==> pop und Paar zum Output hinzufügen'.format(S=S))
|
||||
logDebug('Stack S | {S}; top Element < nextElement; ==> pop und Paar zum Output hinzufügen'.format(S=S))
|
||||
output.append((element, nextElement));
|
||||
S.POP();
|
||||
AddMovesCost();
|
||||
|
Loading…
x
Reference in New Issue
Block a user