Segmented sieve, why is the res variable initialized with 1?
(Algo++) Advanced Data Structures in C++
Doubts
S18IPC-OL0002
(Abhishek Sharma)
June 17, 2018, 4:40pm
#1
segmentedSieve
1920×1080 183 KB
above
res
is initialized to
1
and the loop is not going up to the end value
b
, why?
according to me
res
should be initialized to
0
and the loop should loop till
b
.
Please Explain, thanks.