Data Structures and Algorithms MCQ Questions & Answers
Quiz – 3
- Which of the following algorithms is the best approach for solving Huffman codes?
Ans. greedy algorithm - What is the name of elements present in patterns?
Ans. Pattern variables - What is a time complexity for finding the longest substring that is repeated in a string?
Ans. θ (n)
- 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. - In Huffman coding, data in a tree always occur?
Ans. leaves
- Which type of traversal of binary search tree outputs the value in sorted order?
Ans. In-order
- Which of the following is the efficient data structure for searching words in dictionaries?
Ans. Trie - Prim’s algorithm is a __________
Ans. Greedy algorithm - Which of the following is false about the Kruskal’s algorithm?
Ans. It can accept cycles in the MST
- 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
- The Possible number of spanning trees if 5 number of vertices are given
Ans. 125 - What is the number of edges present in a complete graph having n vertices?
Ans. (n”(n-1))/2 - 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
- What is the maximum height of an AVL tree with p nodes?
Ans. log(p) - What is a time complexity for x pattern occurrence of length n?
Ans. Theta (n+x)
- In what type of tree is the difference between left subtree and right subtree is called balancing factor.
Ans. AVL Tree
- What is the time complexity of Dijkstra’s algorithm?
Ans. O(N2) - What is the maximum number of edges in a bipartite graph having 10 vertices?
Ans. 25 - Which of the following algorithms is the best approach for solving Huffman codes?
Ans. greedy algorithm - What is a full binary tree?
Ans. Each node has exactly zero or two children
For More Updates Join Our Channels :