Vidyalelo
Data Structure · all questions

Binary Search Trees(B Tree)
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

275

Questions

4/14

Page

Pick an option on a question to see the right answer and solution.

Consider a sequence of numbers to have repetitions, how a cartesian tree can be constructed in such situations without violating any rules?

Select an option to see the answer and solution.

The balance factor of a node in a binary tree is defined as . . . . . . . .

Select an option to see the answer and solution.

What is the code below trying to print?
void print(tree *root,tree *node)
{
  if(root ==null) return 0
  if(root-->left==node || root-->right==node) || print(root->left,node)
  ||printf(root->right,node)
  {
     print(root->data)
  }
}

Select an option to see the answer and solution.

Which operation is used to combine two auxiliary trees?

Select an option to see the answer and solution.

Using what formula can a parent node be located in an array?

Select an option to see the answer and solution.

Which of the following is also known as Rope data structure?

Select an option to see the answer and solution.

Why to prefer splay trees?

Select an option to see the answer and solution.

Is Treap a randomized tree.

Select an option to see the answer and solution.

What are double and single threaded trees?

Select an option to see the answer and solution.

Which of the dynamic operations are used in Top Tree data structure implementation?

Select an option to see the answer and solution.

The binary tree sort implemented using a self - balancing binary search tree takes . . . . . . . . time is worst case.

Select an option to see the answer and solution.

A treap is a cartesian tree with . . . . . . . .

Select an option to see the answer and solution.

How many different shapes does maintenance of AA-Tree need to consider?

Select an option to see the answer and solution.

What must be the missing logic in place of missing lines for finding sum of nodes of binary tree in alternate levels?
//e.g:-consider -complete binary tree:-height-3, [1,2,3,4,5,6,7]-answer must be 23
n=power(2,height)-1; //assume input is height and a[i] contains tree elements
for(i=1;i<=n;)
{
      //present level is initialized to 1 and sum is initialized to  0
      for(j=1;j<=pow(2,currentlevel-1);j++) 
      {
         sum=sum+a[i];
         i=i+1;
      }
   //missing logic
}

Options are not available for this question.

Select an option to see the answer and solution.

A full binary tree can be generated using . . . . . . . .

Select an option to see the answer and solution.

For a binary tree the first node visited in in-order and post-order traversal is same.

Select an option to see the answer and solution.

Advantages of linked list representation of binary trees over arrays?

Select an option to see the answer and solution.

Is the below tree representation of 50, 100,400,300,280 correct way to represent cartesian tree?
Binary Search Trees(B Tree) mcq question image

Select an option to see the answer and solution.

What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)

Select an option to see the answer and solution.

What is wrong with below code for inorder traversal of inorder threaded binary tree:
inordertraversal(threadedtreenode root):
threadedtreenode q = inorderpredecessor(root)
while(q!=root):
q=inorderpredecessor(q)
print q.data

Select an option to see the answer and solution.