Tree Data Structures questions

Q10

GATE CS 2021 CS-1Tree Data StructuresMCQ1 mark−1/3 if wrong
A binary search tree TT contains nn distinct elements. What is the time complexity of picking an element in TT that is smaller than the maximum element in TT?
Show answer without attempting

Answer: D

Q2

GATE CS 2021 CS-2Tree Data StructuresMCQ1 mark−1/3 if wrong
Let HH be a binary min-heap consisting of nn elements implemented as an array. What is the worst case time complexity of an optimal algorithm to find the maximum element in HH?
Show answer without attempting

Answer: C

Q16

GATE CS 2021 CS-2Tree Data StructuresNAT1 mark
Consider a complete binary tree with 7 nodes. Let AA denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let BB denote the set of first 3 elements obtained by performing Depth-First Search (DFS) starting from the root.
The value of ∣A−B∣|A - B| is ____________.
Show answer without attempting

Answer: 1

0/30 correct0 marks

Related topics in Programming and Data Structures