Consider the following statements:(i) Depth-first search is used to traverse a rooted tree.(ii) Pre-order, post-order and in-order are used to list the vertices of an ordered rooted tree.(iii) Huffman's algorithm is used to find an optimal binary tree with given weights.(iv) Topological sorting provides a labelling such that the parents have larger labels than their children.Which of the above statements are true?
- A(i) and (ii)
- B(iii) and (iv)
- C(i), (ii) and (iii)
- D(i), (ii), (iii) and (iv)