September 8, 2024

Data Structures and Algorithms MCQ Questions & Answers

Data Structures and Algorithm
Share :

Data Structures and Algorithms MCQ Questions & Answers


Quiz – 3

  1. Which of the following algorithms is the best approach for solving Huffman codes?
    Ans. greedy algorithm
  2. What is the name of elements present in patterns?
    Ans. Pattern variables
  3. What is a time complexity for finding the longest substring that is repeated in a string?
    Ans. θ (n)


  4. From the following which one is the basic principle of bellman-ford algorithm
    Ans. Uses relaxation by overestimate of the true distance and replacing by newfound minimum paths.
  5. In Huffman coding, data in a tree always occur?
    Ans. leaves
  6. Which type of traversal of binary search tree outputs the value in sorted order?
    Ans. In-order


  7. Which of the following is the efficient data structure for searching words in dictionaries?
    Ans. Trie
  8. Prim’s algorithm is a __________
    Ans. Greedy algorithm
  9. Which of the following is false about the Kruskal’s algorithm?
    Ans. It can accept cycles in the MST


  10. If a node having two children is to be deleted from binary search tree, it is replaced by its _________
    Ans. In-order successor

For More Updates Regrading MCQ Questions & Answers – Click Here


For More Updates Join Our Channels :


Quiz – 2

  1. The Possible number of spanning trees if 5 number of vertices are given
    Ans. 125
  2. What is the number of edges present in a complete graph having n vertices?
    Ans. (n”(n-1))/2
  3. B-tree of order n is a order-n multiway tree in which each non-root node contains ___________
    Ans. at least (n-1)/2 keys


  4. What is the maximum height of an AVL tree with p nodes?
    Ans. log(p)
  5. What is a time complexity for x pattern occurrence of length n?
    Ans. Theta (n+x)
  6. In what type of tree is the difference between left subtree and right subtree is called balancing factor.
    Ans. AVL Tree


  7. What is the time complexity of Dijkstra’s algorithm?
    Ans. O(N2)
  8. What is the maximum number of edges in a bipartite graph having 10 vertices?
    Ans. 25
  9. Which of the following algorithms is the best approach for solving Huffman codes?
    Ans. greedy algorithm
  10. What is a full binary tree?
    Ans. Each node has exactly zero or two children



For More Updates Join Our Channels :