search
Log In

Recent questions tagged binary-tree

0 votes
2 answers
1
A complete $n$-ary tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complete $n$-ary tree. If $L=41$, and $I=10$, what is the value of $n$? $3$ $4$ $5$ $6$
asked Nov 20, 2020 in DS jothee 140 views
0 votes
1 answer
2
0 votes
1 answer
3
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number number of nodes in a binary tree of height $h$ is $2^{h}$ $2^{h-1} – 1$ $2^{h+1} – 1$ $2^{h+1}$
asked Apr 1, 2020 in DS Lakshman Patel RJIT 364 views
0 votes
2 answers
5
0 votes
1 answer
6
Traversing a binary tree first root and then left and right subtrees called ______ traversal. postorder. preorder. inorder. none of these.
asked Mar 31, 2020 in DS Lakshman Patel RJIT 212 views
2 votes
1 answer
7
0 votes
2 answers
8
0 votes
2 answers
9
0 votes
2 answers
10
Consider a complete binary tree where the left and the right sub trees of the root are max-heaps. The lower bound for the number of operations to convert the tree to a heap is: $\Omega(\log n)$ $\Omega(n\log n)$ $\Omega(n)$ $\Omega(n^2)$
asked Mar 30, 2020 in DS Lakshman Patel RJIT 319 views
0 votes
3 answers
11
Which of the following statements is false? Optimal binary search tree construction can be performed efficiently using dynamic programming. Breadth-first search cannot be used to find connected components of a graph. Given the prefix and postfix walks of a binary tree, the tree cannot be reconstructed uniquely. Depth-first-search can be used to find the connected components of a graph. a b c d
asked Mar 24, 2020 in Algorithms jothee 408 views
2 votes
4 answers
12
The post-order traversal of binary tree is $ACEDBHIGF$. The pre-order traversal is $\text{A B C D E F G H I}$ $\text{F B A D C E G I H}$ $\text{F A B C D E G H I}$ $\text{A B D C E F G I H}$
asked Jan 13, 2020 in DS Satbir 2.8k views
1 vote
1 answer
13
Argue that since sorting $n$ elements takes $\Omega (n\ lgn)$ time in the worst case in the comparison model, any comparison-based algorithm for constructing a $BST$ from an arbitrary list of n elements takes $\Omega (n\ lgn)$ time in the worst case.
asked Nov 20, 2019 in Algorithms KUSHAGRA गुप्ता 373 views
1 vote
4 answers
14
Consider the following function height, to which pointer to the root node of a binary tree shown below is passed Note that max(a,b) defined by #define max(a,b) (a>b)?a:b. int height(Node *root) The output of the above code will be _________________
asked May 22, 2019 in DS srestha 768 views
1 vote
0 answers
15
The number of node in each left subtree is within a factor of $2.$ of the number of nodes in the corresponding right subtree. Also a node allowed to have only one child if that child has no children. This tree has worst case height $O(logn)$. $N$ is the number of nodes in the binary tree. Is this statement TRUE about Binary Tree?
asked May 7, 2019 in Algorithms srestha 200 views
2 votes
3 answers
16
What is the time complexity for insertion in binary tree in worst case? O(1) O(log n) O(n) O(n log n)
asked Apr 29, 2019 in Programming manikgupta123 516 views
0 votes
0 answers
17
somewhere we seen that formula- How many binary tree possible without labeled =c(2n,n)/n+1. anybody explain how we get this formula.
asked Feb 23, 2019 in DS sandeep singh gaur 134 views
30 votes
10 answers
18
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) _________.
asked Feb 7, 2019 in DS Arjun 12.6k views
0 votes
2 answers
19
Which of the following is not correct about B + Tree, which is used for creating index of relational database table? (a) Key values in each node kept in sorted order (b) Leaf node pointer points to next node (c) B + tree is height balanced tree (d) Non-leaf node have pointers to data records
asked Feb 4, 2019 in Databases HeartBleed 1.1k views
0 votes
1 answer
20
The height of a binary tree is defined as the number of nodes in the longest path from root to the leaf node. Let X be the height of a complete binary tree with 256 nodes. Then the value of X will be Answer 9
asked Jan 28, 2019 in DS Ram Swaroop 352 views
0 votes
0 answers
21
I think its answer is 8 .Please ,can any one make it sure for me :)
asked Jan 25, 2019 in DS Nandkishor3939 185 views
0 votes
0 answers
22
Consider a binary tree for every node | P - Q | <= 2. P represents number of nodes in left subtree of S and Q represents number of nodes in right subtree of S for h > 0. The minimum number of nodes present in such tree of height h = 4 ( Root at 0 level)
asked Jan 16, 2019 in Programming Na462 123 views
3 votes
4 answers
23
Let us there are n nodes which are labelled. Then the number of trees possible is given by the Catalan Number i.e $\binom{2n}{n} / (n+1)$ Then the binary search trees possible is just 1?
asked Jan 16, 2019 in DS sripo 2.4k views
2 votes
2 answers
24
The number of BST possible with 6 node numbered 1,2,3,4,5 and 6 with exactly one leaf node
asked Jan 5, 2019 in DS amit166 160 views
0 votes
1 answer
25
A full binary tree is a tree in which every node other than the leaves has two children. If there are 600 leaves then total number of leaf nodes are?
asked Jan 2, 2019 in DS Prince Sindhiya 192 views
...