Suppose 𝑐 = βŒ©π‘[0], … , 𝑐[π‘˜ βˆ’ 1]βŒͺ is an array of length π‘˜, where all the…

GATE Β· 2015 Β· CS Β· Set 3 Β· Computer Science & IT

Suppose 𝑐 = βŒ©π‘[0], … , 𝑐[π‘˜ βˆ’ 1]βŒͺ is an array of length π‘˜, where all the entries are from the set {0, 1}. For any positive integers π‘Ž and 𝑛, consider the following pseudocode.

image.png



If π‘˜ = 4, 𝑐 = 〈1, 0, 1, 1βŒͺ, π‘Ž = 2 and 𝑛 = 8, then the output of DOSOMETHING(𝑐, π‘Ž, 𝑛) is __________________.

Attempted by 111 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…