Recent questions tagged binary-search-tree

0 0 votes
0 0 answers
516
516 views
Please list out the best free available video playlist for Binary search Trees from Data structures as an answer here (only one playlist per answer). We'll then select th...
0 0 votes
2 2 answers
577
577 views
The preorder traversal of a binary search tree is given by $12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20$.Then postorder traversal will be:$2, 6, 7, 8, 9, 10, 12, 15, 16, 17...
2 2 votes
1 1 answer
1.0k
1.0k views
Let $\text{T}$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $\text{T}$ are:The height of a tree with a single node is $0$.$4$ and ...
127 127 votes
10 answers 10 answers
41.4k
41.4k views
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...
0 0 votes
2 2 answers
1.0k
1.0k views
Suppose a binary search tree has been constructed from the following sequence of numbers in the order in which they arrive : $6, 2, 10, 1, 5, 7, 11, 3, 9, 4, 8.$ Consider...
0 0 votes
1 1 answer
610
610 views
Let $\text{T(n)}$ be the number of different binary search trees on $\text{n}$ distinct elements-then $\text{T(n)} = \displaystyle{\sum_{k=1}^{n}} \text{T(K-1)} \; T(x)$ ...
5 5 votes
2 2 answers
2.1k
2.1k views
The number of insertion sequences of the numbers {1,2,3,4,5,6,7} which would lead to the following BSTHow to tackle this kind of problem. Anyone!
1 1 vote
1 1 answer
1.1k
1.1k views
What is the complexity of inorder traversal for a binary search tree with n nodes? O(log n) whether the tree is balanced or unbalanced.O(log n) if the tree is balanced, O...
2 2 votes
0 0 answers
526
526 views
In a Binary Search Tree, a key with value 5 was searched after traversing nodes with values 1,3,4,6,7,8,9 not necessary in the same order. Lets P is the probability that ...
2 2 votes
1 answers 1 answer
1.3k
1.3k views
Number different of binary search trees which can be created with the elements {12, 34, 22, 43, 13, 45, 55, 94, 99, 23} with 45 as the root is___.
1 1 vote
1 answers 1 answer
883
883 views
Worst case time required to construct a balanced BST given a sorted array of integers which can be inserted in any order
0 0 votes
2 2 answers
1.3k
1.3k views
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 $5$, is _________.Note: Th...
1 1 vote
1 1 answer
491
491 views
In a randomised BST is constructing with 7 distinct elements . What is the probability that its Inorder and postOrder traversal are same
60 60 votes
8 answers 8 answers
27.0k
27.0k views
A binary search tree $T$ contains $n$ distinct elements. What is the time complexity of picking an element in $T$ that is smaller than the maximum element in $T$?$\Theta(...