Consider the following program written in pseudo-code. Assume that x and y are integers.
The number of times that the print statement is executed by the call Count(1024,1024) is _____.
c
AlgorithmsAsymptotic Analysis (O, Omega, Theta Complexities)NAT2 marksHard
1Count(x,y) {
2 if (y != 1){
3 if (x != 1) {
4 print("*");
5 Count(x/2, y);
6 }
7 else {
8 y = y-1;
9 Count(1024, y);
10 }
11 }
12}
13A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.