mardi 19 septembre 2017

Big o notation for a while-loop which use random# generator as a conditions

we have RNG which generate No. between [0.0,1000.0[

in a while loop we count to find out how long does it take to produce a No. < 1.0.

code:

n =0
while ( RNG1000() >= 1.0){
n =+
}

question: what is the O(?)




Aucun commentaire:

Enregistrer un commentaire