PREVIOUS YEAR SOLVED PAPERS - GATE 2020

26. What is the worst case time complexity of inserting n2 elements into an AVL Tree with n elements initially?

  • Option : A
  • Explanation :
    Insertion of an element into AVL requires O(log n) time.
    To insert an element
    1. Find the position, where to insert
    2. After insertion, to satisfy AVL properly, we may need to perform rotation.
    So, (1) take ‘log n time’ and (2) take ‘log n’ time.
    Total time for inserting one element into AVL tree is
    log n + log n = 2 log n ⇒ O (log n).
    Now, To insert n2 elements ⇒ n2 log n
    ⇒ O(n2 log n)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


27. Let G=(V,E) be a directed, weighted graph with weight function w:E→R. For some function f:V→R, for each edge (u,v)∈E, define w′(u,v) as w(u,v)+f(u)−f(v).
Which one of the options completes the following sentence so that it is TRUE ?
“The shortest paths in G under w are shortest paths under w′ too, _________”.

  • Option : A
  • Explanation :
    w(u, v)=(u, v ) edge weight
    w′(u, v) = w(u, v) + [f(u) - f(v)]/0 = w (u, v)
    So, option (A) correct.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


28. Which one of the following predicate formulae is NOT logically valid?
Note that W is a predicate formula without any free occurrence of x.

  • Option : B
  • Explanation :
    ∀x (p(x) → W) ⇒ (∀x p(x)) → W is wrong
    ∀ x [(px) → W] ≡ ∀x [∼P(x) ∨ W]
    ≡ ∀x [∼P(x) ∨ W]
    ≡ ∼ [∃x p(x)] ∨ W)
    ≡ ∃x p(x)] → W
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


29. Consider the Boolean function z(a, b, c).

Which one of the following minterm lists represents the circuit given above?

  • Option : C
  • Explanation :
    z = a + bc
    solving it with K-map

    ∴ Minterms will be
    = ∑m(1, 4, 5, 6, 7)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


30. A computer system with a word length of 32 bits has a 16 MB byte-addressable main memory and a 64 KB, 4-way set associative cache memory with a block size of 256 bytes. Consider the following four physical addresses represent hexadecimal notation.
A1 = 0×42C8A4, A2 = 0×546888,
A3 = 0×6A289C, A4 = 0×5E4880
Which one of the following is TRUE?

  • Option : C
  • Explanation :
    Word length = 32 bit, MM size = 16 MB
    Physical address = 24 bit, CM size = 64 KB
    4-way set associative
    Block size = 256 B
    Number of lines (N) = 64K/256 = 216/28 = 28
    Number of sets (S) = N/P-way = 28/4 = 26
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Related Quiz.
GATE 2020