+ 1
What is the value of "t" ?
t = 0; for i=1 to n { k = n while k <> 1 { k = [ k / 2 ] t = t + 1 } }
27 Réponses
+ 5
t = floor(²log n)*n
Found it :)
+ 2
Ohh
+ 2
What is n?
+ 2
n = ?
+ 1
And please specify the language.
+ 1
Btw, please give the value of n
+ 1
or any input?
+ 1
Ok thank u
+ 1
What do u think about (n/2)-1
+ 1
I dont think so
+ 1
the "while" loop will stop only if the number "n" is a power of two, then t = n * log2 (n)
if the number "n" is not a power of two, then the "while" loop will run infinitely
0
Why dont you try it on Code playground?
0
Will I get the answer?
0
Language is c++ i think and its a test for exam, we cant use pc during it, just paper
0
I dont know😭😭😭
0
Its C++
0
No n dosnt have a specific value
0
No
0
I didnt mean value actually