Tree Data Structures questions

Q37

GATE CS 2016 CS-1Tree Data StructuresMCQ2 marks−2/3 if wrong
An operator delete(i) for a binary heap data structure is to be designed to delete the item in the i-th node. Assume that the heap is implemented in an array and i refers to the i-th index of the array. If the heap tree has depth d (number of edges on the path from the root to the farthest leaf), then what is the time complexity to re-fix the heap efficiently after the removal of the element?
Show answer without attempting

Answer: B

Q11

GATE CS 2016 CS-2Tree Data StructuresNAT1 mark
Breadth First Search (BFS) is started on a binary tree beginning from the root vertex. There is a vertex tt at a distance four from the root. If tt is the nn-th vertex in this BFS traversal, then the maximum possible value of nn is _________.
Show answer without attempting

Answer: 31.0

Q34

GATE CS 2016 CS-2Tree Data StructuresNAT2 marks
A complete binary min-heap is made by including each integer in [1,1023][1, 1023] exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth 0. The maximum depth at which integer 9 can appear is _________.
Show answer without attempting

Answer: 8.0

Q36

GATE CS 2016 CS-2Tree Data StructuresMCQ2 marks−2/3 if wrong
Consider the following New-order strategy for traversing a binary tree:
- Visit the root;
- Visit the right subtree using New-order;
- Visit the left subtree using New-order;

The New-order traversal of the expression tree corresponding to the reverse polish expression
3 4 * 5 - 2 ^ 6 7 * 1 + -
is given by:
Show answer without attempting

Answer: C

Q40

GATE CS 2016 CS-2Tree Data StructuresNAT2 marks
The number of ways in which the numbers 1,2,3,4,5,6,71, 2, 3, 4, 5, 6, 7 can be inserted in an empty binary search tree, such that the resulting tree has height 6, is _________.

Note: The height of a tree with a single node is 0.
Show answer without attempting

Answer: 64.0

0/50 correct0 marks

Related topics in Programming and Data Structures