PGEE 04 || C,DS,ALGO,DL || 2026

Last Updated :
Discuss
Comments

Question 1

A clocked sequential circuit uses two positive-edge-triggered D flip-flops A and B with the following combinational next-state equations: D_A = A ⊕ B, D_B = B'. Starting from the initial state AB = 00, the state sequence is:

AB = 00 → 01 → 10 → 11 → 00 → ... (period = 4). What is the state of the circuit after exactly 101 clock pulses?

  • AB = 00

  • AB = 01

  • AB = 10

  • AB = 11

Question 2

Consider the following recurrence relation:

T(n) = 3T(n/4) + Θ(n log n)

What is the asymptotic solution of T(n) using the Master Theorem? Assume T(1) = Θ(1). Choose the most appropriate option.

  • Θ(n log n)

  • Θ(n^(log₄3))

  • Θ(n log²n)

  • Θ(n²)

Question 3

Rank the following six functions in strictly increasing order of asymptotic growth rate (slowest to fastest):

f₁(n) = n^(log₂ n),

f₂(n) = 2^(√n),

f₃(n) = n! / (n/2)!,

f₄(n) = (log n)^(log n),

f₅(n) = 2^(2^n),

f₆(n) = n^(log log n).

Which of the following orderings is CORRECT?

  • f₆ < f₁ = f₄ < f₂ < f₃ < f₅

  • f₆ < f₄ < f₁ < f₂ < f₃ < f₅

  • f₄ < f₆ < f₁ < f₂ < f₃ < f₅

  • f₆ < f₁ < f₄ < f₃ < f₂ < f₅

Question 4

Consider the following code fragment :

C++
int count = 0;
for (int i = 1; i <= n; i++) {
  for (int j = 1; j <= n; j += i) {
    for (int k = 1; k <= j; k *= 2) {
      count++;
    }
  }
}

What is the tightest asymptotic worst-case time complexity of the above code?

  • Θ(nlog²n)

  • Θ(nlogn·log n)

  • Θ(n·logn·log n)

  • Θ(n²logn)

Question 5

An algorithm must sort n integers, each in the range [1, n²]. Which of the following approaches achieves the BEST asymptotic worst-case time complexity?

  • Merge Sort → O(n log n)

  • Bubble Sort → O(n²)

  • Radix Sort with base n → O(n)

  • Heap Sort → O(n log n)

Question 6

Bellman-Ford is executed on a directed weighted graph G(V, E) from source vertex s for exactly (V−1) iterations. In the V-th relaxation pass, the shortest-path estimate of vertex u is successfully decreased. Which of the following is ALWAYS guaranteed to be true?

  • G contains a negative cycle, and vertex u lies directly ON this cycle

  • G contains a negative cycle reachable from s, and u is reachable FROM (not necessarily on) that cycle

  • The incoming edge (v → u) must have a negative weight

  • The shortest path from s to u contains at least V distinct edges

Question 7

The minimum number of scalar multiplications required to compute the product of the matrix chain A₁ (10×30), A₂ (30×5), A₃ (5×60), A₄ (60×10), A₅ (10×20) using optimal dynamic programming parenthesization is:

  • 7000

  • 7500

  • 6500

  • 5000

Question 8

A 16-bit CPU with byte-addressable memory uses a 2-to-4 decoder for high-order interleaving. The decoder selects one of four banks (Bank₀ to Bank₃) using address lines A₁₅ and A₁₄ from a 16-bit bus (A₁₅-A₀). Which of the following is FALSE?

  • A 16-bit word starting at memory address 0x3FFF is considered "aligned" in this architecture

  • To access a 32-bit double-word starting at address 0x4000, the CPU must activate only Bank₁.

  • If the CPU performs a burst read of 4 bytes starting at address 0x7FFF, the decoder will transition its active output from Bank₁ to Bank₂ during the operation

  • The total addressable space for each individual bank is 16 KB.

Question 9

A 3-bit synchronous Gray code counter cycles through: 000 → 001 → 011 → 010 → 110 → 111 → 101 → 100 → 000. It is implemented using D flip-flops (Q₂ = MSB, Q₀ = LSB). The minimized SOP expression for the next-state logic D₁ (the next state of Q₁) is:

  • D₁ = Q₂'·Q₀ + Q₁·Q₀'

  •  D₁ = Q₂ ⊕ Q₁ ⊕ Q₀

  • D₁ = Q₁·Q₀ + Q₂'·Q₀'

  • D₁ = Q₂'·(Q₀ ⊕ Q₁) + Q₂·Q₁'

Question 10

 In an 8-bit 2's complement representation, the operation (−105) − (−44) is performed. Which of the following gives the correct binary result and overflow status?

  • 1100 0011₂, No overflow

  • 0100 0011₂, Overflow occurs

  • 1100 0011₂, Overflow occurs

  • 0011 1101₂, No overflow

Tags:

There are 20 questions to complete.

Take a part in the ongoing discussion