Cryptography Reference
In-Depth Information
Algorithm A
:
1:
for
i
=
1
to n
do
2: S
[
i
]
←
true
3:
end for
4: S
[1]
←
false
5:
for
i
=
2to
n
do
6:
if
S
[
i
]
then
7:
for
j
=
2
i
to
n
by step of
i
do
8: S
[
j
]
←
false
9:
end for
10:
end if
11:
end for
12:
for
i
=
1to
n
do
13:
if
S
[
i
]
then
14:
print
i
15:
end if
16:
end for
Algorithm B
:
1:
for
i
=
1to
n
do
2: S
[
i
]
←
true
3:
end for
4: S
[1]
←
false
5:
for
i
=
2to
n
do
6:
for
j
←
2
i
to
n
by step of
i
do
7: S
[
j
]
←
false
8:
end for
9:
end for
10:
for
i
1to
n
do
11:
if
S
[
i
]
then
12:
print
i
13:
end if
14:
end for
=
Algorithm D
:
1:
for
i
=
1to
n
do
2: S
[
i
]
←
true
3:
end for
4: S
[1]
←
false
5:
for
i
=
2to
n
do
6:
for
j
=
2to
i
do
7:
if
j
divides
i
then
8: S
[
i
]
←
false
9:
end if
10:
end for
11:
end for
12:
for
i
Algorithm C
:
1:
for
i
=
1to
n
do
2: S
[
i
]
←
true
3:
end for
4: S
[1]
←
false
5:
for
i
=
2to
n
do
6:
if
S
[
i
]
then
7:
for
j
=
i
+
1to
n
do
8:
if
i
divides
j
then
9:
S
[
j
]
←
false
10:
end if
11:
end for
12:
end if
13:
end for
14:
for
i
=
1to
n
do
15:
if
S
[
i
]
then
16:
print
i
17:
end if
18:
end for
1to
n
do
13:
if
S
[
i
]
then
14:
print
i
15:
end if
16:
end for
=
Algorithm E
:
1:
for
i
=
1to
n
do
2: S
[
i
]
←
true
3:
end for
4: S
[1]
←
false
5:
for
i
=
2to
n
do
2to
√
i
do
6:
for
j
=
7:
if
j
divides
i
then
8:
S
[
i
]
←
false
9:
end if
10:
end for
11:
end for
12:
for
i
=
1to
n
do
13:
if
S
[
i
]
then
14:
print
i
15:
end if
16:
end for
Search WWH ::
Custom Search