Recent questions tagged tree

2 2 votes
1 1 answer
128
128 views
Let $T$ be a breadth-first search tree of a undirected graph. Let $(x, y)$ be an edge of $G$ that is not an edge of $T$, then one of $x$ or $y$ is an ancestor of the othe...
2 2 votes
1 1 answer
125
125 views
BFS is performed from the root of a binary tree containing $n$ vertices.For which type of binary tree can BFS require $\Theta(n)$ extra space in the worst case?A complete...
2 2 votes
1 1 answer
103
103 views
Let $G=(V,E)$ be a graph where its BFS tree contains at least 3 layers.Consider the cut $(L_0 \cup L_1,L_2)$, i.e., all nodes that are $2$ edges away from $s$ form one si...
2 2 votes
1 1 answer
97
97 views
If you perform a breadth-first search (BFS) on the given graph, starting from node $6$, which of the edges of the graph will be part of the BFS tree?Assume that ties are ...
1 1 vote
0 0 answers
386
386 views
In how many ways we can insert the elements {1, 2, . . . , 7} into an empty AVL tree so that we don‟t have to perform any rotations on it?
1 1 vote
1 1 answer
316
316 views
 Considering above binary tree, what will be the inorder traversal$\text{BADCEGFH}$$\text{GHFEDCBA}$$\text{BACDEGFH}$$\text{GHFDEBCA}$
2 2 votes
1 1 answer
343
343 views
Arrange the following steps of the Inorder Traversal of Binary Tree in the correct order.Visit the Left subtreeVisit the Root nodeVisit the Right subtreeStart traversing ...
1 1 vote
1 1 answer
371
371 views
$2-3-4$ trees are $\text{B}$ - trees of order $4$. They are isometric of ________ trees.AVLAA$2-3$Red-Black
0 0 votes
1 1 answer
378
378 views
Which of the following graphs are trees?Choose the correct answer from the options given below :$\text{(I)}$ and $\text{(II)}$ Only$\text{(I)}$, $\text{(II)}$ and $\text{...
2 2 votes
1 1 answer
196
196 views
Which traversal method can be used to print the nodes of a binary tree in ascending order?Pre-order traversalPost-order traversalIn-order traversalLevel-order traversal
0 0 votes
1 1 answer
180
180 views
Which of the following is false in the case of a spanning tree of a graph $\text{G}$?It is tree that spans $\text{G}$It is a subgraph of the $\text{G}$It includes every v...
1 1 vote
1 1 answer
613
613 views
Construct a B+ tree to insert the following number(order of the tree is 3) 3, 2, 5, 7, 6, 23, 24, 35, 67, 44, 43, 42, 17, 18, 19.
0 0 votes
0 0 answers
248
248 views
The diameter of a tree on $n$ vertices in which every vertex has degree either $1$ or $3$ is:at least $2 \log _{3}(n+1)$ and at most $\frac{n}{2}$.at least $2 \log _{2}\l...
1 1 vote
3 3 answers
1.2k
1.2k views
The preorder traversal of a binary search tree is $(10,5,1,7,40,50)$. The postorder traversal is$(1,5,7,10,40,50)$$(50,40,10,7,5,1)$$(1,7,5,10,40,50)$$(1,5,7,50,40,10)$ 
1 1 vote
1 1 answer
776
776 views
Let $k$ be a positive integer, and $n=2^{k}-1$. Let $X=\{1,2, \ldots, n\}$ be arranged as a min-heap stored in a complete binary tree, $T$.What can be the smallest possib...
1 1 vote
1 1 answer
553
553 views
Which of the following does not define a tree?A tree is a connected acyclic graph.A tree is a connected graph with $n-1$ edges where ' $n$ ' is the number of vertices in ...
0 0 votes
1 1 answer
446
446 views
Which of the following can be the sequence of nodes examined in a binary search tree while searching for key $98$?$100, 50, 75, 60, 98$$100,120,90,95,98$$200, 70, 100, 95...
4 4 votes
2 2 answers
1.8k
1.8k views
Consider a perfect binary tree with $\mathrm{n}$ nodes and $\mathrm{h}$ height. A tree is perfect when all levels of the tree are completely full. Let root is at depth $0...
3 3 votes
1 1 answer
1.3k
1.3k views
Let $U$ be a finite set and let $h$ be a function mapping $U \times U$ to $U$. Consider the following process that assigns values to all nodes of a complete binary tree w...
–4 –4 votes
2 answers 2 answers
1.7k
1.7k views
*MSQ*The following figure depicts a a. A tree and only treeb. A tree with 3 nodesc. A graph (Since every tree is a graph)d. A graph and only graph
0 0 votes
1 1 answer
1.0k
1.0k views
In GATE if questions just mention a tree then should we assume it to be a directed or undirected tree?Also, if we are having an undirected tree then does the child node c...