Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Suppose C = ❮c[0] ,......,c[k - ]❯ is an array of length k, where all the entries are from the set {0, 1}. For any positive integers a and n, consider the following pseudocode.
    DOSOMETHING (c, a, n)
    z ← 1
    for i ← 0 to k – 1
    do z ← z2 mod n
    if c[i] = 1
      then z ← (z × a) mod n
    rutrun z
    If k = 4, c = ❮1, 0,1, 1❯ , a = 2 and n = 8, then the output of DOSOMETHING (c, a, n) is _________.
    1. 14
    2. 4
    3. 0
    4. None of the above
Correct Option: C

C

i011

20 something



Your comments will be displayed only after manual approval.