Graph and Heap Data Structure MCQs

Graph and Heap Data Structure MCQs

Graph and Heap Data Structure MCQs

  1. What data structure is used for depth first traversal of a graph?
  2. (a) Queue
    (b) Stack
    (c) List
    (d) Tree

    (b) Stack

  3. Graph traversal is different froma tree traversal, because:
  4. (a) Trees are not connected
    (b) Graphs may have loops
    (c) Trees have root
    (d) None of these

    (c) Trees have root

  5. Graphs are represented using ____________.
  6. (a) Adjacency tree
    (b) Adjacency linked list and Matrices
    (c) Both a and b
    (d) Adjacency queue

    (c) Both a and b

  7. Which of the following is true?
  8. (a) Prim’s algorithm initialises with a vertex
    (b) Prim’s algorithm initialises with a edge
    (c) Prim’s algorithm initialises with a vertex which has smallest edge
    (d) Prim’s algorithm initialises with a forest

    (a) Prim’s algorithm initialises with a vertex

  9. Prim’s & Kruskal algorithm are ________.
  10. (a) Divide and conquer algorithm
    (b) Greedy algorithm
    (c) Dynamic Programming
    (d) Approximation algorithm

    (b) Greedy algorithm

  11. What is the time complexity of Kruskal’s algorithm?
  12. (a) O(log V)
    (b) O(E log V)
    (c) O(E2)
    (d) O(V log E)

    (b) O(E log V)

  13. What is an AVL tree?
  14. (a) a tree which is balanced and is a height balanced tree
    (b) a tree which is unbalanced and is a height balanced tree
    (c) a tree with three children
    (d) a tree with atmost 3 children

    (a) a tree which is balanced and is a height balanced tree

  15. Why to prefer AVL trees?*
  16. (a) AVL Tree is easiest to implement.
    (b) AVL tree store balance factor in every node which costs space
    (c) AVL tree fails at scale
    (d) AVL Tree is not efficient

    (b) AVL tree store balance factor in every node which costs space

  17. In a max-heap, element with the greatest key is always in the which node?
  18. (a) Leaf node
    (b) First node of left sub tree
    (c) Root node
    (d) First node of right sub tree

    (c) Root node

  19. Heap Data Structure can be used as _______.
  20. (a) Priority queue
    (b) Stack
    (c) A decreasing order array
    (d) Normal Array

    (a) Priority queue

  21. Depth First Search is equivalent to which of the traversal in the Binary Trees?
  22. (a) Pre-order Traversal
    (b) Post-order Traversal
    (c) Level-order Traversal
    (d) In-order Traversal

    (a) Pre-order Traversal

  23. Time Complexity of Breadth First Search is? (V – number of vertices, E – number of edges)
  24. (a) O(V+E)
    (b) o(v)
    (c) o(E)
    (d) None of the mentioned

    (a) O(V+E)

  25. Symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier (or symbol) in a program’s source code is associated with information relating to its declaration or appearance in the source.
  26. (a) True
    (b) False

    (a) True

  27. heap can be used as
  28. (a) Priority queue
    (b) Stack
    (c) A decreasing order array
    (d) Normal Array

    (a) Priority queue

  29. what is the complexity of adding an element to the heap _______.
  30. (a) O(log n)
    (b) O(log h)
    (c) O(h)
    (d) Both A and C

    (d) Both A and C

  31. In a max-heap, element with the greatest key is always in the which node?
  32. (a) Leaf node
    (b) First node of left sub tree
    (c) Root node
    (d) First node of right sub tree

    (c) Root node

  33. what is the complexity of adding an element to the heap
  34. (a) O(log n)
    (b) O(nlog n)
    (c) nlog
    (d) logn

    (a) O(log n)

  35. the worst case complexity of deleting any arbitrary node value element from heap is
  36. (a) O(logn)
    (b) O(n)
    (c) O(nlogn)
    (d) O(n^2)

    (a) O(logn)

  37. A connected planar graph having 6 vertices, 7 edges contains _____________ regions.
  38. (a) 15
    (b) 3
    (c) 1
    (d) 11

    (b) 3

  39. Which of the following properties does a simple graph not hold?
  40. (a) Must be connected
    (b) Must be unweighted
    (c) Must have no loops or multiple edges
    (d) Must have no multiple edges

    (a) Must be connected

  41. For a given graph G having v vertices and e edges which is connected and has no cycles, which of the following statements is true?
  42. (a) v=e
    (b) v = e+1
    (c) v + 1 = e
    (d) v = e-1

    (b) v = e+1

  43. A graph with all vertices having equal degree is known as a __________.
  44. (a) Multi Graph
    (b) Regular Graph
    (c) Simple Graph
    (d) Complete Graph

    (b) Regular Graph

  45. Which of the following statements for a simple graph is correct?
  46. (a) Every path is a trail
    (b) Every trail is a path
    (c) Every trail is a path as well as every path is a trail
    (d) Path and trail have no relation

    (a) Every path is a trail

  47. What is the number of edges present in a complete graph having n vertices?
  48. (a) (n (n+1)/2
    (b) (n*(n-1)/2)
    (c) r
    (d) Information given is insufficient

    (b) (n*(n-1)/2)


Related Posts:
See also  Data Structure and Alogrithm MCQs
Related Topics

Graph and Heap Data Structure MCQs“,”graph data structure mcqs”,”heap data structure mcqs”,”mcq on data structure with answers pdf”,”data structure multiple choice questions and answers doc”,”mcq on graph in dsa”,”Heap Data Structure”,”heap data structure mcqs”