master > master: minor
This commit is contained in:
parent
b193d1d61e
commit
3505401c7f
@ -41,8 +41,8 @@ func NextGreaterElement(L []int) [][2]int {
|
|||||||
for !S.EMPTY() { // ACHTUNG: schreibe 'while' im Pseudocode, denn dies ist eine while-Schleife in golang
|
for !S.EMPTY() { // ACHTUNG: schreibe 'while' im Pseudocode, denn dies ist eine while-Schleife in golang
|
||||||
element := S.TOP()
|
element := S.TOP()
|
||||||
if element < nextElement {
|
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)
|
||||||
// falls top Element < next Element, zum Output hinzufügen und vom Stack
|
|
||||||
addToOutput(element, nextElement)
|
addToOutput(element, nextElement)
|
||||||
S.POP()
|
S.POP()
|
||||||
metrics.AddMovesCost()
|
metrics.AddMovesCost()
|
||||||
|
@ -55,7 +55,7 @@ def NextGreaterElement(L: List[int]) -> List[Tuple[int,int]]:
|
|||||||
logDebug('Stack S | {S}'.format(S=S));
|
logDebug('Stack S | {S}'.format(S=S));
|
||||||
while not S.EMPTY():
|
while not S.EMPTY():
|
||||||
element = S.TOP();
|
element = S.TOP();
|
||||||
# falls element < next Element, zum Output hinzufügen
|
# falls element < next Element, zum Output hinzufügen und vom Stack entfernen
|
||||||
if element < nextElement:
|
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))
|
||||||
addToOutput(element, nextElement);
|
addToOutput(element, nextElement);
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
- Stacks + Queues
|
- Stacks + Queues
|
||||||
- LIFO=FILO vs. FIFO=LILO
|
- LIFO=FILO vs. FIFO=LILO
|
||||||
- PseudoCode-Algorithmus für NextGreaterElement mittels Stacks erarbeitet und diskutiert
|
- PseudoCode-Algorithmus für NextGreaterElement mittels Stacks erarbeitet und diskutiert
|
||||||
- ACHTUNG: im code-Ordner ([go-Variante](../code/golang/pkg/algorithms/stacks/next_greater_element/next_greater_element.go) und [python-Variante](../code/python/src/algorithms/stacks/next_greater_element.py)) habe ich einen vereinfachten Algorithmus implementiert.
|
- ACHTUNG: im code-Ordner ([go-Variante](../code/golang/pkg/algorithms/stacks/next_greater_element/next_greater_element.go) und [python-Variante](../code/python/src/algorithms/stacks/next_greater_element.py)) habe ich einen vereinfachten Algorithmus implementiert.
|
||||||
- Gruppe 2:
|
- Gruppe 2:
|
||||||
- PseudoCode-Algorithmus für NextGreaterElement mittels Stacks erarbeitet und diskutiert
|
- PseudoCode-Algorithmus für NextGreaterElement mittels Stacks erarbeitet und diskutiert
|
||||||
- ACHTUNG: im code-Ordner ([go-Variante](../code/golang/pkg/algorithms/stacks/next_greater_element/next_greater_element.go) und [python-Variante](../code/python/src/algorithms/stacks/next_greater_element.py)) habe ich einen vereinfachten Algorithmus implementiert.
|
- ACHTUNG: im code-Ordner ([go-Variante](../code/golang/pkg/algorithms/stacks/next_greater_element/next_greater_element.go) und [python-Variante](../code/python/src/algorithms/stacks/next_greater_element.py)) habe ich einen vereinfachten Algorithmus implementiert.
|
||||||
- Grundkonzepte für gerichtete/ungerichtete Graphen und Bäume besprochen
|
- Grundkonzepte für gerichtete/ungerichtete Graphen und Bäume besprochen
|
||||||
|
|
||||||
## Nächste Woche ##
|
## Nächste Woche ##
|
||||||
|
Loading…
x
Reference in New Issue
Block a user