search
Log In

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 _____________
asked Feb 18 in DS Arjun 1k views
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$
asked Nov 20, 2020 in DS jothee 361 views
0 votes
0 answers
3
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}$
asked Apr 1, 2020 in DS Lakshman Patel RJIT 423 views
0 votes
2 answers
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.
asked Mar 31, 2020 in DS Lakshman Patel RJIT 498 views
2 votes
1 answer
8
0 votes
2 answers
9
0 votes
2 answers
10
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)$
asked Mar 30, 2020 in DS Lakshman Patel RJIT 389 views
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
asked Mar 24, 2020 in Algorithms jothee 601 views
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})$
asked Feb 12, 2020 in DS Arjun 4.1k views
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}$
asked Jan 13, 2020 in DS Satbir 6.9k views
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.
asked Nov 20, 2019 in Algorithms KUSHAGRA गुप्ता 508 views
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 _________________
asked May 22, 2019 in DS srestha 842 views
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?
asked May 7, 2019 in Algorithms srestha 236 views
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)
asked Apr 29, 2019 in Programming manikgupta123 626 views
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.
asked Feb 23, 2019 in DS sandeep singh gaur 154 views
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) _________.
asked Feb 7, 2019 in DS Arjun 15.5k views
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
asked Feb 4, 2019 in Databases HeartBleed 1.9k views
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
asked Jan 28, 2019 in DS Ram Swaroop 429 views
0 votes
0 answers
23
I think its answer is 8 .Please ,can any one make it sure for me :)
asked Jan 25, 2019 in DS Nandkishor3939 214 views
...