Data Structure - Programming Language (MCQ) questions for Q. 7929

Q.  Which of the following statements is true for Binary search Trees?
- Published on 25 Aug 15

a. The left subtree of a node contains only nodes with keys less than the node's key.
b. The right subtree of a node contains only nodes with keys greater than the node's key.
c. Both a and b above
d. Both left and right subtree nodes contains only nodes with keys less than the node's key.

ANSWER: Both a and b above
 

    Discussion

  • Nirja Shah   -Posted on 21 Nov 15
    A binary search tree satisfies the following properties.
    - All the keys in the left subtree of root are less than the key of root.
    - All the keys in the right subtree of root are greater than the key of root.
    - Left and right subtree of root should also BST.
    Inorder traversal of a binary search tree gives the ascending order of keys.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)