DATA STRUCTURE
Programming and Technical
Programming
Basics
Which of the following traversal is used for printing the keys of Binary search tree in ascending order?
[1]post-order traversal
[2]pre-order traversal
[3]in-order traversal
[4]None of the above
Read Solution (Total 7)
-
- in-order traversal
in the in-order traversal we start from the leftmost leaf-node so in this way we will get element in ascending order
- 8 years agoHelpfull: Yes(5) No(0)
- To get in ascending order you need to traverse in "IN-ORDER"
"PRE ORDER Traversal " is Clockwise traversal i.e., Parent Node, Left Node and Right Node.
"POST ORDER Traversal " is Anti-Clockwise traversal i.e., Left Node ,Right Node and Parent Node.
"IN-ORDER Traversal " is like "A" i.e., Left Node ,Parent Node and Right Node. - 8 years agoHelpfull: Yes(4) No(0)
- [3]in-order traversal
- 8 years agoHelpfull: Yes(2) No(0)
- 3.in-order traversal
left-root-right...according to this the keys of BST are in ascending order - 8 years agoHelpfull: Yes(1) No(0)
- In-order Traversal. Left, Root, Right
- 7 years agoHelpfull: Yes(0) No(0)
- in order traversal is used to write keys in ascending order.
- 7 years agoHelpfull: Yes(0) No(0)
- in-order, since in in-order traversal we display first left child then root and after that right child and a/c to def of binary search tree the left child is smaller then root and the right child is greater than root so in-order will give us ascending order
- 6 years agoHelpfull: Yes(0) No(0)
DATA STRUCTURE Other Question