Commerce

Binary Search TreesB Tree MCQs

Practice Binary Search TreesB Tree MCQs for competitive exams.

Binary Search TreesB Tree MCQs

Practice questions from this topic.

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

  1. A. O(n log n)
  2. B. O(n)
  3. C. O(n 2 )
  4. D. O(log n)
Report Error

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

  1. A. Link
  2. B. Cut
  3. C. Expose
  4. D. All of the mentioned
Report Error

What are double and single threaded trees?

  1. A. when both left, right nodes are having null pointers and only right node is null pointer respectively
  2. B. having 2 and 1 node
  3. C. using single and double linked lists
  4. D. using heaps and priority queues
Report Error

Is Treap a randomized tree.

  1. A. True
  2. B. False
Report Error

Why to prefer splay trees?

  1. A. easier to program
  2. B. space efficiency
  3. C. easier to program and faster access to recently accessed items
  4. D. quick searching
Report Error

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

  1. A. Cord
  2. B. String
  3. C. Array
  4. D. Linked List
Report Error

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

  1. A. (i+1)/2
  2. B. (i-1)/2
  3. C. i/2
  4. D. 2i/2
Report Error

Which operation is used to combine two auxiliary trees?

  1. A. Join
  2. B. Combinatorial
  3. C. Add
  4. D. Concatenation
Report Error

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) } }

  1. A. just printing all nodes
  2. B. not a valid logic to do any task
  3. C. printing ancestors of a node passed as argument
  4. D. printing nodes from leaf node to a node passed as argument
Report Error

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

  1. A. addition of heights of left and right subtrees
  2. B. height of right subtree minus height of left subtree
  3. C. height of left subtree minus height of right subtree
  4. D. height of right subtree minus one
Report Error

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

  1. A. use any tie-breaking rule between repeated elements
  2. B. cartesian tree is impossible when repetitions are present
  3. C. construct a max heap in such cases
  4. D. construct a min heap in such cases
Report Error

Several other operations like union set difference and intersection can be done in treaps.

  1. A. True
  2. B. False
Report Error