Informatiker Board (http://www.informatikerboard.de/board/index.php)
- Themengebiete (http://www.informatikerboard.de/board/board.php?boardid=1)
--- Praktische Informatik (http://www.informatikerboard.de/board/board.php?boardid=6)
---- Algorithmen (http://www.informatikerboard.de/board/board.php?boardid=17)
----- <-> im Pseudocode und Invariante (http://www.informatikerboard.de/board/thread.php?threadid=4003)


Geschrieben von Fate3 am 03.09.2018 um 14:42:

  <-> im Pseudocode und Invariante

Ich soll für folgenden Algorithmus die Schleifeninvariante bestimmen doch leider weiß ich nicht wie ich mit dem Pfeil in beide richtungen umgehen soll (es soll wohl tauschen bedeuten):

code:
1:
2:
3:
4:
5:
x<- 1
for i <- 1 to n do
 x <-> x*5
end
return x


Wäre die Invariante hier: 5^n ?


Forensoftware: Burning Board, entwickelt von WoltLab GmbH