Consider the following statements:
(a) Depth – first search is used to traverse a rooted tree.
(b) Pre – order, Post-order and Inorder are used to list the vertices of an ordered rooted tree.
(c) Huffman’s algorithm is used to find an optimal binary tree with given weights.
(d) Topological sorting provides a labelling such that the parents have larger labels than their children.
Which of the above statements are true?
(A) (a) and (b)
(B) (c) and (d)
(C) (a), (b) and (c)
(D) (a), (b), (c) and (d)
Answer: (D)
Explanation:
- Depth – first search is used to traverse a rooted tree. Correct
- Pre – order, Post-order and Inorder are used to list the vertices of an ordered rooted tree. Correct
- Huffman’s algorithm is used to find an optimal binary tree with given weights.
- Correct
- Topological sorting provides a labelling such that the parents have larger labels than their children.Correct
So, option (D) is correct.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.