Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for binary-tree
1
votes
7
answers
1
The maximum number of nodes on level i of a binary tree
Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children of root is 2. The maximum number of nodes on level i of a binary tree is In the following answers, the operator '^' indicates power a) 2^i-1 b)2^i c)2^i+1 d)2^(i+1/2)
Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children of root is 2. The maximum number of nodes on lev...
Akanksha Kesarwani
102k
views
Akanksha Kesarwani
asked
Jan 16, 2016
DS
binary-tree
data-structures
+
–
168
votes
17
answers
2
GATE CSE 2016 Set 2 | Question: 40
The number of ways in which the numbers $1, 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$.
The number of ways in which the numbers $1, 2, 3, 4, 5, 6, 7$ can be inserted in an empty binary search tree, such that the resulting tree has height $6$, is _________.No...
Akash Kanase
50.0k
views
Akash Kanase
asked
Feb 12, 2016
DS
gatecse-2016-set2
data-structures
binary-search-tree
normal
numerical-answers
+
–
174
votes
13
answers
3
GATE IT 2007 | Question: 29
When searching for the key value $60$ in a binary search tree, nodes containing the key values $10, 20, 40, 50, 70, 80, 90$ are traversed, not necessarily in the order given. How many different orders are possible in which these key values can occur on the search path from the root to the node containing the value $60$? $35$ $64$ $128$ $5040$
When searching for the key value $60$ in a binary search tree, nodes containing the key values $10, 20, 40, 50, 70, 80, 90$ are traversed, not necessarily in the order gi...
Ishrat Jahan
39.4k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2007
data-structures
binary-search-tree
normal
+
–
40
votes
5
answers
4
GATE CSE 2009 | Question: 37,ISRO-DEC2017-55
What is the maximum height of any AVL-tree with $7$ nodes? Assume that the height of a tree with a single node is $0$. $2$ $3$ $4$ $5$
What is the maximum height of any AVL-tree with $7$ nodes? Assume that the height of a tree with a single node is $0$.$2$$3$$4$$5$
Kathleen
43.6k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2009
data-structures
binary-search-tree
normal
isrodec2017
avl-tree
+
–
129
votes
6
answers
5
GATE CSE 2008 | Question: 46
You are given the postorder traversal, $P$, of a binary search tree on the $n$ elements $1, 2, \dots, n$. You have to determine the unique binary search tree that has $P$ as its postorder traversal. What is the time complexity of the most efficient algorithm ... $\Theta(\log n)$ $\Theta(n)$ $\Theta(n\log n)$ None of the above, as the tree cannot be uniquely determined
You are given the postorder traversal, $P$, of a binary search tree on the $n$ elements $1, 2, \dots, n$. You have to determine the unique binary search tree that has $P...
Kathleen
39.2k
views
Kathleen
asked
Sep 12, 2014
DS
gatecse-2008
data-structures
binary-search-tree
normal
+
–
119
votes
8
answers
6
GATE CSE 2014 Set 3 | Question: 39
Suppose we have a balanced binary search tree $T$ holding $n$ numbers. We are given two numbers $L$ and $H$ and wish to sum up all the numbers in $T$ that lie between $L$ and $H$. Suppose there are $m$ such numbers in $T$. If the tightest upper bound on the time to compute the sum is $O(n^a\log^bn+m^c\log^dn)$, the value of $a+10b+100c+1000d$ is ______.
Suppose we have a balanced binary search tree $T$ holding $n$ numbers. We are given two numbers $L$ and $H$ and wish to sum up all the numbers in $T$ that lie between $L$...
go_editor
31.6k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set3
data-structures
binary-search-tree
numerical-answers
normal
+
–
103
votes
11
answers
7
GATE CSE 2004 | Question: 85
A program takes as input a balanced binary search tree with $n$ leaf nodes and computes the value of a function $g(x)$ for each node $x$. If the cost of computing $g(x)$ ... time complexity of the program is? $\Theta (n)$ $\Theta (n \log n)$ $\Theta(n^2)$ $\Theta (n^2\log n)$
A program takes as input a balanced binary search tree with $n$ leaf nodes and computes the value of a function $g(x)$ for each node $x$. If the cost of computing $g(x)$ ...
Kathleen
33.1k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
binary-search-tree
normal
data-structures
+
–
48
votes
9
answers
8
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
+
–
48
votes
7
answers
9
GATE CSE 1997 | Question: 4.5
A binary search tree contains the value $1, 2, 3, 4, 5, 6, 7, 8$. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output? $5 \ 3 \ 1 \ 2 \ 4 \ 7 \ 8 \ 6$ $5 \ 3 \ 1 \ 2 \ 6 \ 4 \ 8 \ 7$ $5 \ 3 \ 2 \ 4 \ 1 \ 6 \ 7 \ 8$ $5 \ 3 \ 1 \ 2 \ 4 \ 7 \ 6 \ 8$
A binary search tree contains the value $1, 2, 3, 4, 5, 6, 7, 8$. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a...
Kathleen
37.5k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
binary-search-tree
normal
+
–
27
votes
5
answers
10
GATE CSE 1996 | Question: 2.14
A binary search tree is generated by inserting in order the following integers: $50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24$ The number of nodes in the left subtree and right subtree of the root respectively is $(4, 7)$ $(7, 4)$ $(8, 3)$ $(3, 8)$
A binary search tree is generated by inserting in order the following integers:$$50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24$$The number of nodes in the left subtree and ...
Kathleen
30.6k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-search-tree
easy
+
–
43
votes
6
answers
11
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
+
–
71
votes
9
answers
12
GATE CSE 2019 | Question: 46
Let $T$ be a full binary tree with $8$ leaves. (A full binary tree has every level full.) Suppose two leaves $a$ and $b$ of $T$ are chosen uniformly and independently at random. The expected value of the distance between $a$ and $b$ in $T$ (ie., the number of edges in the unique path between $a$ and $b$) is (rounded off to $2$ decimal places) _________.
Let $T$ be a full binary tree with $8$ leaves. (A full binary tree has every level full.) Suppose two leaves $a$ and $b$ of $T$ are chosen uniformly and independently at ...
Arjun
30.8k
views
Arjun
asked
Feb 7, 2019
DS
gatecse-2019
numerical-answers
data-structures
binary-tree
2-marks
+
–
29
votes
4
answers
13
GATE CSE 2020 | Question: 41
In a balanced binary search tree with $n$ elements, what is the worst case time complexity of reporting all elements in range $[a,b]$? Assume that the number of reported elements is $k$. $\Theta (\log n)$ $\Theta (\log n +k)$ $\Theta (k \log n)$ $\Theta ( n \log k)$
In a balanced binary search tree with $n$ elements, what is the worst case time complexity of reporting all elements in range $[a,b]$? Assume that the number of reported ...
Arjun
22.0k
views
Arjun
asked
Feb 12, 2020
DS
gatecse-2020
data-structures
binary-search-tree
2-marks
+
–
102
votes
7
answers
14
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.5k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
normal
+
–
57
votes
11
answers
15
GATE IT 2006 | Question: 9
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree is $10$ $11$ $12$ $15$
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree i...
Ishrat Jahan
26.2k
views
Ishrat Jahan
asked
Oct 31, 2014
DS
gateit-2006
data-structures
binary-tree
normal
+
–
42
votes
12
answers
16
GATE CSE 2015 Set 3 | Question: 25
Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______.
Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______.
go_editor
24.4k
views
go_editor
asked
Feb 14, 2015
DS
gatecse-2015-set3
data-structures
binary-tree
normal
numerical-answers
+
–
54
votes
7
answers
17
GATE CSE 1996 | Question: 4
A binary search tree is used to locate the number $43$ ...
A binary search tree is used to locate the number $43$. Which of the following probe sequences are possible and which are not? Explain.$\begin{array}{llllll} \text{(a)} ...
Kathleen
23.0k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-search-tree
normal
descriptive
+
–
35
votes
12
answers
18
GATE CSE 2015 Set 2 | Question: 10
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
go_editor
30.5k
views
go_editor
asked
Feb 12, 2015
DS
gatecse-2015-set2
data-structures
binary-tree
normal
numerical-answers
+
–
41
votes
3
answers
19
GATE CSE 2022 | Question: 18
Suppose a binary search tree with $1000$ distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with $0,$ the $3^{\text{rd}}$ largest element of the tree is stored at index ______________ .
Suppose a binary search tree with $1000$ distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assumin...
Arjun
15.3k
views
Arjun
asked
Feb 15, 2022
DS
gatecse-2022
numerical-answers
data-structures
binary-search-tree
1-mark
+
–
29
votes
3
answers
20
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.9k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-tree
normal
+
–
Page:
1
2
3
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register