1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
|
n:= 1; // 1 ELOP
h:= x; // 1 ELOP
while (h>1) { // x ELOP (Die Schleife wird x-1 mal durchlaufen, also x Abfragen - einfach mal mit kleiner Zahl ausprobieren)
h := h/2; // 2(x-1) ELOPS
n := n+1 // 2(x-1) ELOPS
}
//jetzt ist n==x
while (n > 0) { // x + 1 ELOP
yn := x%2; // xn ELOPS
x := x/2; // xn ELOPS
n := n-1; // xn ELOPS
} |