Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged binary-search-tree
2
votes
2
answers
211
CMI2013-A-03
When a user submits a query, a search engine does the following. For every webpage that has been visited by the search engine, it computes a score indicating how relevant that page is to the query. Finally, it reports the pages with the top k scores on the ... the user. A good data structure for accumulating the scores and ranking them is: a queue a heap a stack a binary search tree
When a user submits a query, a search engine does the following. For every webpage that has been visited by the search engine, it computes a score indicating how relevant...
go_editor
1.2k
views
go_editor
asked
May 23, 2016
DS
cmi2013
data-structures
binary-search-tree
+
–
0
votes
1
answer
212
Time complexity to search for an element in a balanced bst with (2n)! Elements?
gshivam63
422
views
gshivam63
asked
May 19, 2016
DS
data-structures
time-complexity
binary-search-tree
+
–
1
votes
1
answer
213
Postorder traversal after creating AVL tree
The tree given is as follows: 30 / \ 12 45 \ 18 Insert: 10,15,40,20,22 Which one of the following is the postorder traversal of the resultant tree? (A) 10,15,13,20,22,30,45,40,18 (B) 10,15,12,20,30,22,45,40,18 (C) 10,15,12,20,30,22,45,18,40 (D) None of these
The tree given is as follows: 30 / \ 12 45 \ 18 Insert: 10,15,40,20,22Which one of the following is the postorder tr...
GateAspirant999
5.2k
views
GateAspirant999
asked
Apr 23, 2016
DS
data-structures
avl-tree
binary-search-tree
+
–
168
votes
17
answers
214
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
+
–
0
votes
1
answer
215
MadeEasy Test Series: Programming & DS - Binary Search Trees
Q). Find the number of trees that are possible .If we construct a binary search tree by successively inserting $5$ distinct items int an initially empty tree. a). $4$ b). $10$ c). $14$ d). $20$ I used the formula 2n!/(n+1)!*n!. Is it right ? also the ans given is 14,but I am getting 7.
Q). Find the number of trees that are possible .If we construct a binary search tree by successively inserting $5$ distinct items int an initially empty tree.a). $4$b). $...
UK
746
views
UK
asked
Jan 29, 2016
DS
made-easy-test-series
data-structures
binary-search-tree
+
–
1
votes
2
answers
216
Binary Search tree
A binary search tree was constructed by inserting following elements into an initially empty binary tree. 50, 27, 16, 88, 34, 65, 52, 77, 93, 4, 12, 29, 44, 92 Preorder and postorder traversals of the resultant binary search tree were stored in arrays ... present in these to array A and B ___________. Everything is ok here,, But not getting how length of LCS is calculated here.
A binary search tree was constructed by inserting following elements into an initially empty binary tree. 50, 27, 16, 88...
Akanksha Kesarwani
3.5k
views
Akanksha Kesarwani
asked
Jan 23, 2016
Programming in C
data-structures
binary-search-tree
+
–
6
votes
5
answers
217
What is the time complexity to construct binary search tree when inorder and postorder traversal of tree is given?
nilamd
6.8k
views
nilamd
asked
Jan 18, 2016
DS
data-structures
binary-search-tree
+
–
0
votes
2
answers
218
Ace Test Series: Programming & DS - Binary Search Trees
I am stuck after JAN. It is not getting balanced even after 2 rotations. Can somebody help?
I am stuck after JAN. It is not getting balanced even after 2 rotations. Can somebody help?
Tushar Shinde
959
views
Tushar Shinde
asked
Jan 15, 2016
DS
ace-test-series
data-structures
binary-search-tree
avl-tree
+
–
1
votes
1
answer
219
MadeEasy Test Series 2018: Programming & DS - Binary search Tree
When searching for the key value 50 in a binary search tree, node containing the key values 10, 30, 40, 70, 90, 120, 150, 175 are traversed, in any order. The number of different orders passing in which these keys values can occur on the search path from the root to node containing the value 50 are ________.
When searching for the key value 50 in a binary search tree, node containing the key values 10, 30, 40, 70, 90, 120, 150, 175 are traversed, in any order. The number of d...
Sandeep Singh
1.1k
views
Sandeep Singh
asked
Dec 27, 2015
DS
data-structures
binary-search-tree
made-easy-test-series
+
–
0
votes
2
answers
220
Test Series QS - Algorithms
When searching for the key value 50 in a binary search tree, node containing the key values 10, 30, 40, 70, 90, 120, 150, 175 are traversed, in any order. The number of different orders passing in which these keys values can occur on the search path from the root to node containing the value 50 are ________.
When searching for the key value 50 in a binary search tree, node containing the key values 10, 30, 40, 70, 90, 120, 150, 175 are traversed, in any order. The number of d...
mysticPrince
521
views
mysticPrince
asked
Dec 8, 2015
DS
data-structures
binary-search-tree
numerical-answers
made-easy-test-series
+
–
0
votes
3
answers
221
how to construct BST by given preorder and postorder traversal
Given preorder and postorder traversal of binary search tree. Preorder: 50, 27, 16, 4, 12, 34, 29, 44, 88, 65, 52, 77, 93, 92 Postorder: 12, 4, 16, 29, 44, 34, 27, 52, 77, 65, 92, 93, 88, 50 The number of nodes present at level 3 are _________. Assume root is present at level 0.
Given preorder and postorder traversal of binary search tree.Preorder: 50, 27, 16, 4, 12, 34, 29, 44, 88, 65, 52, 77, 93, 92Postorder: 12, 4, 16, 29, 44, 34, 27, 52, 77, ...
resuscitate
4.4k
views
resuscitate
asked
Dec 8, 2015
Algorithms
data-structures
binary-search-tree
+
–
1
votes
1
answer
222
BST
certain file system stores records as per binary search tree principles.If the preorder traversal is 90,40,30,190,140,100,290.What is the expected number of comparisons when we randomly request one of the records?
certain file system stores records as per binary search tree principles.If the preorder traversal is 90,40,30,190,140,100,290.What is the expected number of comparisons w...
shreshtha5
573
views
shreshtha5
asked
Nov 30, 2015
DS
binary-search-tree
numerical-answers
+
–
1
votes
1
answer
223
No of BST ?
Aditya
383
views
Aditya
asked
Nov 6, 2015
DS
binary-search-tree
+
–
49
votes
5
answers
224
TIFR CSE 2010 | Part B | Question: 26
Suppose there is a balanced binary search tree with $n$ nodes, where at each node, in addition to the key, we store the number of elements in the sub tree rooted at that node. Now, given two elements $a$ and $b$, such that $a < b$ ... $O(n)$ comparisons and $O(n)$ additions, using depth-first- search.
Suppose there is a balanced binary search tree with $n$ nodes, where at each node, in addition to the key, we store the number of elements in the sub tree rooted at that ...
makhdoom ghaya
8.8k
views
makhdoom ghaya
asked
Oct 6, 2015
DS
tifr2010
binary-search-tree
+
–
10
votes
3
answers
225
ISRO2011-11
How many distinct binary search trees can be created out of $4$ distinct keys? $5$ $14$ $24$ $35$
How many distinct binary search trees can be created out of $4$ distinct keys?$5$$14$$24$$35$
ajit
10.3k
views
ajit
asked
Oct 1, 2015
DS
isro2011
data-structures
binary-search-tree
combinatory
+
–
0
votes
1
answer
226
Optimal binary search tree
Given the following table of data what are the minimum expected no.of comparisons required for an Optimal i 0 1 2 3 4 Pi 3/16 3/16 1/16 1/16 Qi 2/16 3/16 1/16 1/16 1/16 BST that can be constructed with the given data
Given the following table of data what are the minimum expected no.of comparisons required for an Optimali01234Pi 3/163/161/161/16Qi2/163/161/161/161/16BST that can be co...
supraja
4.3k
views
supraja
asked
Apr 28, 2015
DS
data-structures
binary-search-tree
numerical-answers
+
–
25
votes
8
answers
227
GATE CSE 2015 Set 3 | Question: 13
While inserting the elements $71, 65, 84, 69, 67, 83$ in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is $65$ $67$ $69$ $83$
While inserting the elements $71, 65, 84, 69, 67, 83$ in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is$65$$67$$69$$83$
go_editor
7.4k
views
go_editor
asked
Feb 14, 2015
DS
gatecse-2015-set3
data-structures
binary-search-tree
easy
+
–
47
votes
3
answers
228
GATE CSE 2015 Set 1 | Question: 23
What are the worst-case complexities of insertion and deletion of a key in a binary search tree? $\Theta(\log n)$ for both insertion and deletion $\Theta(n)$ for both insertion and deletion $\Theta(n)$ for insertion and $\Theta(\log n)$ for deletion $\Theta(\log n)$ for insertion and $\Theta(n)$ for deletion
What are the worst-case complexities of insertion and deletion of a key in a binary search tree?$\Theta(\log n)$ for both insertion and deletion$\Theta(n)$ for both inser...
makhdoom ghaya
10.5k
views
makhdoom ghaya
asked
Feb 13, 2015
DS
gatecse-2015-set1
data-structures
binary-search-tree
easy
+
–
25
votes
3
answers
229
GATE CSE 2015 Set 1 | Question: 10
Which of the following is/are correct in order traversal sequence(s) of binary search tree(s)? $3, 5, 7, 8, 15, 19, 25$ $5, 8, 9, 12, 10, 15, 25$ $2, 7, 10, 8, 14, 16, 20$ $4, 6, 7, 9, 18, 20, 25$ I and IV only II and III only II and IV only II only
Which of the following is/are correct in order traversal sequence(s) of binary search tree(s)?$3, 5, 7, 8, 15, 19, 25$$5, 8, 9, 12, 10, 15, 25$$2, 7, 10, 8, 14, 16, 20$$4...
makhdoom ghaya
7.4k
views
makhdoom ghaya
asked
Feb 12, 2015
DS
gatecse-2015-set1
data-structures
binary-search-tree
easy
+
–
2
votes
1
answer
230
Answer the following question
In 28 my answer is c but answer given is d.
In 28 my answer is c but answer given is d.
Sahil Gupta
381
views
Sahil Gupta
asked
Dec 19, 2014
DS
data-structures
binary-search-tree
made-easy-booklet
+
–
27
votes
4
answers
231
GATE IT 2005 | Question: 55
A binary search tree contains the numbers $1, 2, 3, 4, 5, 6, 7, 8.$ When the tree is traversed in pre-order and the values in each node printed out, the sequence of values obtained is $5, 3, 1, 2, 4, 6, 8, 7.$ ... $1, 2, 3, 4, 8, 7, 6, 5$ $2, 1, 4, 3, 6, 7, 8, 5$ $2, 1, 4, 3, 7, 8, 6, 5$
A binary search tree contains the numbers $1, 2, 3, 4, 5, 6, 7, 8.$ When the tree is traversed in pre-order and the values in each node printed out, the sequence of value...
Ishrat Jahan
9.3k
views
Ishrat Jahan
asked
Nov 3, 2014
DS
gateit-2005
data-structures
binary-search-tree
normal
+
–
53
votes
7
answers
232
GATE IT 2005 | Question: 12
The numbers $1, 2, .\dots n$ are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains $p$ nodes. The first number to be inserted in the tree must be $p$ $p + 1$ $n - p$ $n - p + 1$
The numbers $1, 2, .\dots n$ are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains $p$ nodes. The first number...
Ishrat Jahan
13.5k
views
Ishrat Jahan
asked
Nov 3, 2014
DS
gateit-2005
data-structures
normal
binary-search-tree
+
–
30
votes
5
answers
233
GATE IT 2006 | Question: 45
Suppose that we have numbers between $1$ and $100$ in a binary search tree and want to search for the number $55$. Which of the following sequences CANNOT be the sequence of nodes examined? $\{10, 75, 64, 43, 60, 57, 55\}$ $\{90, 12, 68, 34, 62, 45, 55\}$ $\{9, 85, 47, 68, 43, 57, 55\}$ $\{79, 14, 72, 56, 16, 53, 55\}$
Suppose that we have numbers between $1$ and $100$ in a binary search tree and want to search for the number $55$. Which of the following sequences CANNOT be the sequence...
Ishrat Jahan
18.8k
views
Ishrat Jahan
asked
Oct 31, 2014
DS
gateit-2006
data-structures
binary-search-tree
normal
+
–
174
votes
13
answers
234
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
+
–
32
votes
2
answers
235
GATE IT 2008 | Question: 73
How many distinct BSTs can be constructed with $3$ distinct keys? $4$ $5$ $6$ $9$
How many distinct BSTs can be constructed with $3$ distinct keys?$4$$5$$6$$9$
Ishrat Jahan
12.6k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2008
data-structures
binary-search-tree
normal
+
–
37
votes
3
answers
236
GATE IT 2008 | Question: 72
A Binary Search Tree (BST) stores values in the range $37$ to $573$. Consider the following sequence of keys. $81, 537, 102, 439, 285, 376, 305$ $52, 97, 121, 195, 242, 381, 472$ $142, 248, 520, 386, 345, 270, 307$ ... inorder sequence of some BST where $121$ is the root and $52$ is a leaf IV is a postorder sequence of some BST with $149$ as the root
A Binary Search Tree (BST) stores values in the range $37$ to $573$. Consider the following sequence of keys.$81, 537, 102, 439, 285, 376, 305$$52, 97, 121, 195, 242, 381...
Ishrat Jahan
6.2k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2008
data-structures
binary-search-tree
easy
+
–
55
votes
4
answers
237
GATE IT 2008 | Question: 71
A Binary Search Tree (BST) stores values in the range $37$ to $573$. Consider the following sequence of keys. $81, 537, 102, 439, 285, 376, 305$ $52, 97, 121, 195, 242, 381, 472$ $142, 248, 520, 386, 345, 270, 307$ ... list nodes in the order in which we could have encountered them in the search? II and III only I and III only III and IV only III only
A Binary Search Tree (BST) stores values in the range $37$ to $573$. Consider the following sequence of keys.$81, 537, 102, 439, 285, 376, 305$$52, 97, 121, 195, 242, 381...
Ishrat Jahan
14.7k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2008
data-structures
binary-search-tree
normal
+
–
32
votes
2
answers
238
GATE IT 2008 | Question: 12
Which of the following is TRUE? The cost of searching an AVL tree is $\Theta (\log n)$ but that of a binary search tree is $O(n)$ The cost of searching an AVL tree is $\Theta (\log n)$ but that of a complete binary tree is $\Theta (n \log n)$ The cost ... is $\Theta(n)$ The cost of searching an AVL tree is $\Theta (n \log n)$ but that of a binary search tree is $O(n)$
Which of the following is TRUE?The cost of searching an AVL tree is $\Theta (\log n)$ but that of a binary search tree is $O(n)$The cost of searching an AVL tree is $\The...
Ishrat Jahan
12.0k
views
Ishrat Jahan
asked
Oct 27, 2014
DS
gateit-2008
data-structures
binary-search-tree
easy
avl-tree
+
–
54
votes
7
answers
239
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
+
–
27
votes
5
answers
240
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.7k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-search-tree
easy
+
–
Page:
« prev
1
...
3
4
5
6
7
8
9
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register