Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged binary-tree
61
votes
5
answers
301
GATE IT 2008 | Question: 77
A binary tree with $n > 1$ nodes has $n_1$, $n_2$ and $n_3$ nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbours. Starting with the above tree, while there remains a node $v$ of degree two in the tree, add ... will remain at the end of the process? $2 * n_1- 3$ $n_2 + 2 * n_1 - 2$ $n_3 - n_2$ $n_2+ n_1- 2$
A binary tree with $n 1$ nodes has $n_1$, $n_2$ and $n_3$ nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbo...
Ishrat Jahan
14.8k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2008
data-structures
binary-tree
normal
+
–
42
votes
5
answers
302
GATE IT 2008 | Question: 76
A binary tree with $n > 1$ nodes has $n_1$, $n_2$ and $n_3$ nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbours. $n_3$ can be expressed as $n_1 + n_2 - 1$ $n_1 -2$ $[((n_1 + n_2)/2)]$ $n_2 - 1$
A binary tree with $n 1$ nodes has $n_1$, $n_2$ and $n_3$ nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbo...
Ishrat Jahan
16.9k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2008
data-structures
binary-tree
normal
+
–
21
votes
3
answers
303
GATE IT 2008 | Question: 46
The following three are known to be the preorder, inorder and postorder sequences of a binary tree. But it is not known which is which. $MBCAFHPYK$ $KAMCBYPFH$ $MABCKYFPH$ Pick the true statement from the following. I and II are preorder ... , but nothing more can be said about the other two sequences II and III are the preorder and inorder sequences, respectively
The following three are known to be the preorder, inorder and postorder sequences of a binary tree. But it is not known which is which.$MBCAFHPYK$$KAMCBYPFH$$MABCKYFPH$Pi...
Ishrat Jahan
6.8k
views
Ishrat Jahan
asked
Oct 28, 2014
DS
gateit-2008
data-structures
normal
binary-tree
+
–
21
votes
3
answers
304
GATE CSE 1996 | Question: 1.15
Which of the following sequences denotes the post order traversal sequence of the below tree? $f\; e\; g\; c\; d\; b\; a$ $g\; c\; b\; d\; a\; f\; e$ $g\; c\; d\; b\; f\; e\; a$ $f\; e\; d\; g\; c\; b \;a$
Which of the following sequences denotes the post order traversal sequence of the below tree?$f\; e\; g\; c\; d\; b\; a$$g\; c\; b\; d\; a\; f\; e$$g\; c\; d\; b\; f\; e\...
Kathleen
4.4k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-tree
easy
+
–
29
votes
3
answers
305
GATE CSE 1996 | Question: 1.14
In the balanced binary tree in the below figure, how many nodes will become unbalanced when a node is inserted as a child of the node “g”? $1$ $3$ $7$ $8$
In the balanced binary tree in the below figure, how many nodes will become unbalanced when a node is inserted as a child of the node “g”?$1$$3$$7$$8$
Kathleen
12.3k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-tree
normal
+
–
25
votes
3
answers
306
GATE CSE 1995 | Question: 6
What is the number of binary trees with $3$ nodes which when traversed in post-order give the sequence $A, B, C ?$ Draw all these binary trees.
What is the number of binary trees with $3$ nodes which when traversed in post-order give the sequence $A, B, C ?$ Draw all these binary trees.
Kathleen
3.7k
views
Kathleen
asked
Oct 8, 2014
DS
gate1995
data-structures
binary-tree
normal
descriptive
+
–
43
votes
6
answers
307
GATE CSE 1995 | Question: 1.17
A binary tree $T$ has $n$ leaf nodes. The number of nodes of degree $2$ in $T$ is $\log_2 n$ $n-1$ $n$ $2^n$
A binary tree $T$ has $n$ leaf nodes. The number of nodes of degree $2$ in $T$ is$\log_2 n$$n-1$$n$$2^n$
Kathleen
36.1k
views
Kathleen
asked
Oct 8, 2014
DS
gate1995
data-structures
binary-tree
normal
+
–
35
votes
3
answers
308
GATE CSE 1994 | Question: 8
A rooted tree with $12$ nodes has its nodes numbered $1$ to $12$ in pre-order. When the tree is traversed in post-order, the nodes are visited in the order $3, 5, 4, 2, 7, 8, 6, 10, 11, 12, 9, 1$. Reconstruct the original tree from this information, that is, find the parent of each node, and show the tree diagrammatically.
A rooted tree with $12$ nodes has its nodes numbered $1$ to $12$ in pre-order. When the tree is traversed in post-order, the nodes are visited in the order $3, 5, 4, 2, 7...
Kathleen
7.2k
views
Kathleen
asked
Oct 5, 2014
DS
gate1994
data-structures
binary-tree
normal
descriptive
+
–
19
votes
2
answers
309
GATE CSE 1993 | Question: 16
Prove by the principal of mathematical induction that for any binary tree, in which every non-leaf node has $2$-descendants, the number of leaves in the tree is one more than the number of non-leaf nodes.
Prove by the principal of mathematical induction that for any binary tree, in which every non-leaf node has $2$-descendants, the number of leaves in the tree is one more ...
Kathleen
3.0k
views
Kathleen
asked
Sep 29, 2014
DS
gate1993
data-structures
binary-tree
normal
descriptive
+
–
22
votes
3
answers
310
GATE CSE 1997 | Question: 16
A size-balanced binary tree is a binary tree in which for every node the difference between the number of nodes in the left and right subtree is at most $1$. The distance of a node from the root is the length of the path from the root to the ... height $h \geqslant 1$, how many nodes are at distance $h-1$ from the root? Write only the answer without any explanations.
A size-balanced binary tree is a binary tree in which for every node the difference between the number of nodes in the left and right subtree is at most $1$. The distance...
Kathleen
5.0k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
binary-tree
normal
descriptive
proof
+
–
57
votes
12
answers
311
GATE CSE 2010 | Question: 10
In a binary tree with $n$ nodes, every node has an odd number of descendants. Every node is considered to be its own descendant. What is the number of nodes in the tree that have exactly one child? $0$ $1$ $\frac{(n-1)}{2}$ $n-1$
In a binary tree with $n$ nodes, every node has an odd number of descendants. Every node is considered to be its own descendant. What is the number of nodes in the tree ...
go_editor
16.3k
views
go_editor
asked
Sep 29, 2014
DS
gatecse-2010
data-structures
binary-tree
normal
+
–
43
votes
3
answers
312
GATE CSE 2012 | Question: 47
The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudo-code below is invoked as height (root) to compute the height of a binary tree rooted at the tree pointer root. int height(treeptr n) { if(n == NULL) return -1 ... ; B2: $\max(h1, h2) $ B1: $(1+ \text{height}(n \to \text{ right}))$ ; B2: $\max(h1, h2)$
The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudo-code below is invoked as height (root) to compute...
Arjun
11.1k
views
Arjun
asked
Sep 29, 2014
DS
gatecse-2012
data-structures
binary-tree
normal
+
–
48
votes
9
answers
313
GATE CSE 2011 | Question: 29
We are given a set of $n$ distinct elements and an unlabeled binary tree with $n$ nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree? $0$ $1$ $n!$ $\frac{1} {n+1} .^{2n}C_n$
We are given a set of $n$ distinct elements and an unlabeled binary tree with $n$ nodes. In how many ways can we populate the tree with the given set so that it becomes a...
go_editor
31.9k
views
go_editor
asked
Sep 29, 2014
DS
gatecse-2011
binary-tree
normal
+
–
90
votes
11
answers
314
GATE CSE 2014 Set 1 | Question: 12
Consider a rooted n node binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly $4$ nodes is $O(n^a\log^bn)$. Then the value of $a+10b$ is __________.
Consider a rooted n node binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly $4$ nodes is...
go_editor
24.6k
views
go_editor
asked
Sep 26, 2014
DS
gatecse-2014-set1
data-structures
binary-tree
numerical-answers
normal
+
–
20
votes
1
answer
315
GATE CSE 1998 | Question: 20
Draw the binary tree with node labels $\text{a, b, c, d, e, f and g}$ for which the inorder and postorder traversals result in the following sequences: Inorder: $\text{a f b c d g e}$ Postorder: $\text{a f c g e d b}$
Draw the binary tree with node labels $\text{a, b, c, d, e, f and g}$ for which the inorder and postorder traversals result in the following sequences:Inorder: $\text{a f...
Kathleen
4.7k
views
Kathleen
asked
Sep 26, 2014
DS
gate1998
data-structures
binary-tree
descriptive
+
–
29
votes
4
answers
316
GATE CSE 2007 | Question: 46
Consider the following C program segment where $CellNode$ represents a node in a binary tree: struct CellNode { struct CellNode *leftChild; int element; struct CellNode *rightChild; }; int Getvalue (struct CellNode *ptr) { int value = 0; if (ptr != NULL) ... in the tree the number of internal nodes in the tree the number of leaf nodes in the tree the height of the tree
Consider the following C program segment where $CellNode$ represents a node in a binary tree:struct CellNode { struct CellNode *leftChild; int element; struct CellNode *r...
Kathleen
8.6k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-tree
normal
+
–
17
votes
3
answers
317
GATE CSE 2007 | Question: 39, UGCNET-June2015-II: 22
The inorder and preorder traversal of a binary tree are $\text{d b e a f c g}$ and $\text{a b d e c f g}$, respectively The postorder traversal of the binary tree is: $\text{d e b f g c a}$ $\text{e d b g f c a}$ $\text{e d b f g c a}$ $\text{d e f g b c a}$
The inorder and preorder traversal of a binary tree are$\text{d b e a f c g}$ and $\text{a b d e c f g}$, respectivelyThe postorder traversal of the binary tree is:$\text...
Kathleen
7.7k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-tree
normal
ugcnetcse-june2015-paper2
+
–
29
votes
3
answers
318
GATE CSE 2007 | Question: 13
The maximum number of binary trees that can be formed with three unlabeled nodes is: $1$ $5$ $4$ $3$
The maximum number of binary trees that can be formed with three unlabeled nodes is:$1$$5$$4$$3$
Kathleen
31.8k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-tree
normal
+
–
26
votes
4
answers
319
GATE CSE 2007 | Question: 12
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is: $2^h -1$ $2^{h-1} -1$ $2^{h+1} -1$ $2^{h+1}$
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is:$2^h -1$$2^{h-1} -1$$2^...
Kathleen
25.9k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-tree
easy
+
–
40
votes
3
answers
320
GATE CSE 2004 | Question: 43
Consider the following C program segment struct CellNode{ struct CellNode *leftChild int element; struct CellNode *rightChild; }; int Dosomething (struct CellNode *ptr) { int value = 0; if(ptr != NULL) { if (ptr -> leftChild != NULL) value = 1 + ... leaf nodes in the tree The number of nodes in the tree The number of internal nodes in the tree The height of the tree
Consider the following C program segmentstruct CellNode{ struct CellNode *leftChild int element; struct CellNode *rightChild; }; int Dosomething (struct CellNode *ptr) { ...
Kathleen
8.7k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
binary-tree
normal
+
–
27
votes
3
answers
321
GATE CSE 2004 | Question: 35
Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs identify a tree uniquely? preorder and postorder inorder and postorder preorder and inorder level order and postorder I only II, III III only IV only
Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs identify a tree uniquely?preorder and postorderi...
Kathleen
8.9k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
binary-tree
normal
+
–
67
votes
4
answers
322
GATE CSE 2006 | Question: 13
A scheme for storing binary trees in an array $X$ is as follows. Indexing of $X$ starts at $1$ instead of $0$. the root is stored at $X[1]$. For a node stored at $X[i]$, the left child, if any, is stored in $X[2i]$ and the right child, if any, in $X[2i+1]$. To be able to store any binary tree on n vertices the minimum size of $X$ should be $\log_2 n$ $n$ $2n+1$ $2^n-1$
A scheme for storing binary trees in an array $X$ is as follows. Indexing of $X$ starts at $1$ instead of $0$. the root is stored at $X $. For a node stored at $X[i]$, th...
Rucha Shelke
17.2k
views
Rucha Shelke
asked
Sep 17, 2014
DS
gatecse-2006
data-structures
binary-tree
normal
+
–
20
votes
1
answer
323
GATE CSE 2002 | Question: 6
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.
Kathleen
2.6k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
easy
descriptive
+
–
102
votes
7
answers
324
GATE CSE 2002 | Question: 2.12
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the furthest ... which of the following? $\log_2 n$ $\log_{\frac{4}{3}} n$ $\log_3 n$ $\log_{\frac{3}{2}} n$
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the rig...
Kathleen
23.4k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
normal
+
–
48
votes
4
answers
325
GATE CSE 2000 | Question: 2.16
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited `in a postorder, inorder and preorder traversal respectively, of a complete binary tree. Which of the following is always true? LASTIN = LASTPOST LASTIN = LASTPRE LASTPRE = LASTPOST None of the above
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal respectively, of a complete binary tree. Which of the foll...
Kathleen
17.7k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2000
data-structures
binary-tree
normal
+
–
33
votes
8
answers
326
GATE CSE 2000 | Question: 1.14
Consider the following nested representation of binary trees: $(X \ Y \ Z)$ indicates $Y$ and $Z$ are the left and right subtrees, respectively, of node $X$. Note that $Y$ and $Z$ may be $NULL$ ... $(1 \ (2 \ 3 \ 4) \ (5 \ 6 \ 7))$ $(1 \ (2 \ 3 \ NULL) \ (4 \ 5))$
Consider the following nested representation of binary trees: $(X \ Y \ Z)$ indicates $Y$ and $Z$ are the left and right subtrees, respectively, of node $X$. Note that $Y...
Kathleen
11.0k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2000
data-structures
binary-tree
easy
+
–
25
votes
3
answers
327
GATE CSE 1991 | Question: 14,a
Consider the binary tree in the figure below: What structure is represented by the binary tree?
Consider the binary tree in the figure below:What structure is represented by the binary tree?
Kathleen
4.3k
views
Kathleen
asked
Sep 12, 2014
DS
gate1991
data-structures
binary-tree
time-complexity
easy
descriptive
+
–
44
votes
2
answers
328
GATE CSE 1991 | Question: 01,viii
The weighted external path length of the binary tree in figure is ______
The weighted external path length of the binary tree in figure is ______
Kathleen
13.7k
views
Kathleen
asked
Sep 12, 2014
DS
gate1991
binary-tree
data-structures
normal
numerical-answers
+
–
20
votes
5
answers
329
GATE CSE 1991 | Question: 1,ix
If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______
If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______
Kathleen
5.5k
views
Kathleen
asked
Sep 12, 2014
DS
gate1991
binary-tree
easy
data-structures
descriptive
+
–
Page:
« prev
1
...
6
7
8
9
10
11
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register