How to practice concept:binary-search-trees

Attempt a question, record the concept and assumptions, then check the available answer. Rework mistakes after revising the relevant concepts. Topic tags can overlap; review the question context.

Questions 1–10 of 13. Imported answers require independent review unless marked reviewed.

Topic practice 13 questionsPage 1 of 2

Question 40

Open question
CSMCQ2 marksNeeds review
Let

be the set of all integers from 1 to 15. Consider any order of insertion of the elements of

into a binary search tree that creates a complete binary tree.
Which one of the following elements can NEVER be the third element that is inserted?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 49

Open question
CS2MSQ2 marksNeeds review
Consider a binary search tree (BST) with

leaf nodes (

). Given any node

, the key present in the node is denoted as

. All the keys present in the given BST are distinct. The keys belong to the set of real numbers.
For a node

, let

denote the node that is its inorder successor. If a node

does not have an inorder successor, then

is

. As there are no duplicates, if

is not

, then

.
Corresponding to every leaf node

that has a non-NULL

, a new key

with the following property is to be inserted into the BST.

Let

represent the list of all such new keys to be inserted into the BST.
Which of the following statements is/are true?
Your answerSelect all correct options. You can choose more than one.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 62

Open question
CSNAT2 marksNeeds review
The following sequence corresponds to the preorder traversal of a binary search tree

:
50, 25, 13, 40, 30, 47, 75, 60, 70, 80, 77
The position of the element 60 in the postorder traversal of

is _____. (answer in integer)
Note: The position begins with 1.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 26

Open question
CSMSQ1 markNeeds review
Which of the following statement(s) is/are TRUE for any binary search tree (BST) having

distinct integers?
Your answerSelect all correct options. You can choose more than one.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 35

Open question
CSNAT1 markNeeds review
Suppose the values 10, −4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let

be the resulting binary search tree. The number of edges in the path from the node containing 19 to the root node of

is __________. (Answer in integer)

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 38

Open question
CSMCQ2 marksNeeds review
A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data structures:
P: Unsorted doubly linked list with pointers to the head node and tail node of the list.
Q: Min-heap implemented using an array.
R: Binary Search Tree.
Which ONE of the following options gives the worst-case time complexities for meld operation on instances of size

of these data structures?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 39

Open question
CSMCQ2 marksNeeds review
You are given a set V of distinct integers. A binary search tree T is created by inserting all elements of V one by one, starting with an empty tree. The tree T follows the convention that, at each node, all values stored in the left subtree of the node are smaller than the value stored at the node. You are not aware of the sequence in which these values were inserted into T, and you do not have access to T.
Which one of the following statements is TRUE?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 28

Open question
CSNAT1 markNeeds review
Suppose a binary search tree with 100 distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with 0, the 3rd largest element of the tree is stored at index ____________.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 10

Open question
CSMCQ1 markNeeds review
A binary search tree

contains

distinct elements. What is the time complexity of picking an element in

that is smaller than the maximum element in

?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 5

Open question
CSMCQ1 markNeeds review
The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19.
Which one of the following is the postorder traversal of the tree?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer