# Recent questions tagged binary-tree 2 votes
2 answers
1
Consider a complete binary tree with $7$ nodes. Let $A$ denote the set of first $3$ elements obtained by performing Breadth-First Search $\text{(BFS)}$ starting from the root. Let $B$ denote the set of first $3$ elements obtained by performing Depth-First Search $\text{(DFS)}$ starting from the root. The value of $\mid A-B \mid$ is _____________
0 votes
2 answers
2
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$
0 votes
0 answers
3
A full binary tree with $n$ non-leaf nodes contains $\log_ 2 n$ nodes $n+1$ nodes $2n$ nodes $2n+1$ nodes
0 votes
1 answer
4
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}$
0 votes
0 answers
5
The number of possible binary trees with $4$ nodes is $12$ $13$ $14$ $15$
0 votes
2 answers
6
In a full binary tree number of nodes is $63$ then the height of the tree is : $2$ $4$ $3$ $6$
0 votes
0 answers
7
Traversing a binary tree first root and then left and right subtrees called ______ traversal. postorder. preorder. inorder. none of these.
2 votes
1 answer
8
The number of unused pointers in a complete binary tree of depth $5$ is: $4$ $8$ $16$ $32$
0 votes
2 answers
9
Which of the following need not be a binary tree? Search tree Heap AVL tree B tree
0 votes
2 answers
10
The maximum number of nodes in a binary tree of level $k, k\geq1$ is: $2^k+1$ $2^{k-1}$ $2^k-1$ $2^{k-1}-1$
0 votes
2 answers
11
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)$
0 votes
3 answers
12
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
5 votes
2 answers
13
What is the worst case time complexity of inserting $n^{2}$ elements into an AVL-tree with $n$ elements initially? $\Theta (n^{4})$ $\Theta (n^{2})$ $\Theta (n^{2}\log n)$ $\Theta (n^{3})$
2 votes
4 answers
14
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}$
1 vote
1 answer
15
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.
1 vote
4 answers
16
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 _________________
1 vote
0 answers
17
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?
3 votes
3 answers
18
What is the time complexity for insertion in binary tree in worst case? O(1) O(log n) O(n) O(n log n)
0 votes
0 answers
19
somewhere we seen that formula- How many binary tree possible without labeled =c(2n,n)/n+1. anybody explain how we get this formula.
35 votes
9 answers
20
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) _________.
0 votes
2 answers
21
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
0 votes
1 answer
22
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
0 votes
0 answers
23
I think its answer is 8 .Please ,can any one make it sure for me :)