• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Binary Trees Data Structure with Answers

Question 41

Find the inorder and postorder of the binary tree with the given preorder: 60, 40, 20, 10, 30, 33, 50, 44, 51, 90, 70, 65, 80, 110, 100, 95, 99, 120.
  • In order: 110, 100, 99, 90, 80, 70, 65, 60, 51, 50, 44, 40, 33, 30, 20, 10. Postorder: 110, 120, 100, 95, 99, 70, 80, 65, 60, 40, 50, 51, 44, 20, 30, 33, 10
  • Inorder: 10, 20, 30, 33, 40, 44, 50, 51, 60, 65, 70, 80, 90, 95, 99, 100, 110, 120 Postorder: 10, 33, 30, 20, 44, 51, 50, 40, 65, 80, 70, 99, 95, 100, 120, 110, 90, 60
  • In order: 10, 33, 30, 20, 44, 51, 50, 40, 60, 65, 80, 70, 99, 95, 100, 120, 110, Postorder: 10, 20, 30, 33, 40, 44, 50, 51, 60, 65, 70, 80, 90, 95, 99, 100, 110
  • In order: 10, 33, 30, 20, 44, 51, 60, 65, 80, 70, 99, 95, 100, 120, 110, Postorder: 110, 100, 99, 90, 80, 70, 65, 60, 51, 50, 44, 40, 33, 30, 20, 10.

Question 42

A binary search tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 19 leaves :
  • cannot have more than 37 nodes
  • has exactly 37 nodes
  • has exactly 35 nodes
  • cannot have more than 35 nodes

Question 43

Consider a complete binary tree with 7 nodes. Let A denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let B denote the set of first 3 elements obtained by performing Depth-First Search (DFS) starting from the root. The value of ∣A−B∣ is _____________ .
  • 1
  • 2
  • 3
  • 4

Question 44

Which of the following sequences denotes the post order traversal sequence of the given tree?
         a
       /   \\
      b     e
     / \\   /
    c  d  f
   /
  g

  • f e g c d b a
  • g c b d a f e
  • g c d b f e a
  • f e d g c b a

Question 45

The in-order and pre-order traversal of a binary tree are d b e a f c g and a b d e c f g respectively. The post order traversal of a binary tree is
  • e d b g f c a
  • e d b f g c a
  • d e b f g c a
  • d e f g b c a

Question 46

Consider an array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i<=n), the index of the parent is: 




 

  • ceiling (i/2)

  • floor (i/2)

  • ceiling ((i+1)/2)

  • floor ((i+1)/2)

Question 47

What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?
  • Θ(√n)
  • Θ(log2(n))
  • Θ(n2)
  • Θ(n)

Question 48

Consider a binary tree with n nodes, where each node can have at most two children. The height of the tree is defined as the maximum number of edges between the root node and any leaf node. Which of the following statements is true regarding the height h of this binary tree?

  • The height of the tree is always equal to n-1.

  • The height of the tree can be greater than or equal to n-1.

  • The height of the tree is always equal to log₂(n).

  • The height of the tree can be greater than or equal to log₂(n).

Question 49

A size-balanced binary tree is a binary tree in which for every node, the difference between the number of nodes in the left and right subtree is at most 1. The distance of a node from the root is the length of the path from the root to the node. The height of a binary tree is the maximum distance of a leaf node from the root. a. Prove, by using induction on h, that a size-balance binary tree of height h contains at least 2h nodes. b. In a size-balanced binary tree of height h≤1, how many nodes are at distance h−1 from the root? Write only the answer without any explanations.

    Question 50

    Draw the binary tree with node labels a, b, c, d, e, f and g for which the inorder and postorder traversals result in the following sequences:
    Inorder       a f b c d g e
    Postorder     a f c g e d b
    
    

      There are 52 questions to complete.

      Last Updated :
      Take a part in the ongoing discussion