Recent questions tagged binary-tree

0 0 votes
1 1 answer
708
708 views
For the height of the tree for gate what should we consider the number of edges from the root the leaf or number of levels.????
4 4 votes
4 4 answers
9.6k
9.6k views
How many different binary search trees can be constructed using six distinct keys? 256 128 132 264
1 1 vote
1 answers 1 answer
1.1k
1.1k views
Please tell me - 1) What is top down evaluation of Parse tree?2) What is Bottom Up evaluation of Parse Tree3) What is Depth First left to right evaluation of Parse tree?I...
2 2 votes
3 answers 3 answers
5.5k
5.5k views
Let T be a rooted binary tree whose vertices are labelled with symbols a, b, c, d, e, f, g, h, i, j, k. Suppose the in-order and post-order traversals of T produce the fo...
2 2 votes
3 answers 3 answers
3.7k
3.7k views
For a binary tree T,preorder traversal yields: 11,8,6,4,7,10,19,43,31,29,37,49 andinorder traversal yields: 4,6,7,8,10,11,19,29,31,37,43,49The height of the T is _____...
14 14 votes
3 3 answers
8.0k
8.0k views
A Full Binary Tree is a binary tree where every node has either 0 or 2 children.what i knowwith Preorder and Inorder , Inorder and Postorder and Inorder and Level-order ...
0 0 votes
1 1 answer
2.1k
2.1k views
Given the preorder/postorder and inorder traversal of a binary tree, we can always construct a unique binary tree (I think so, correct me if I am wrong)Construct a binary...
0 0 votes
0 0 answers
745
745 views
Consider programint foo(struct node *tree){if(tree==0)return 0;int lh=ht(tree->left);int rh=ht(tree->right);int ld=foo(tree->left);int rd=foo(tree->right);return max(lh+r...
2 2 votes
3 answers 3 answers
1.5k
1.5k views
The minimum size that an array may require to store a binary tree with 'n' nodes is ______.A. $2^{\left \lceil \log (n+1)) \right \rceil}-1$B. $2^{n}-1$C. $2^{n}-n-1$D. n...
1 1 vote
2 2 answers
4.2k
4.2k views
Consider a full binary tree with $n$ internal nodes, internal path length $I$, and external path length $e$. the internal length of a full binary tree is the sum, taken o...
1 1 vote
1 1 answer
1.5k
1.5k views
A rooted tree with 8 nodes has its nodes [1.....8] in preorder.When the tree is traversed in postorder.....nodes visited are{3,5,4,2,7,8,6,1}.Draw a tree for it.How to s...
3 3 votes
1 answers 1 answer
2.4k
2.4k views
Number of rooted labeled trees(i.e. each node can be the root) with 6 vertices is:
2 2 votes
0 0 answers
1.8k
1.8k views
Consider the following routine on binary treevoid do(struct btnode *t) { if(t) { Do(t->Rightchild); Do(t->Leftchild); swap(t->Rightchild,t->Leftchild); } }1) What does Do...
3 3 votes
0 0 answers
834
834 views
In a binary tree, the time complexity of best upper and lower bound time required to get number of subtrees having exactly 8 nodes?
0 0 votes
2 2 answers
5.0k
5.0k views
In a full binary tree of height k, there are ______ internal nodes .2k-1 2k-1 2k 2k+1
2 2 votes
2 2 answers
1.7k
1.7k views
A binary tree is said to have heap property if the elements along any path :from leaf to root are non-increasing from leaf to root are non-decreasing from root to l...
1 1 vote
0 0 answers
568
568 views
https://gateoverflow.in/2604/gate1995_1-17 .What is the degree of a node in a tree? Is it same as a graph OR the number of children of that node?
0 0 votes
2 answers 2 answers
3.7k
3.7k views
If the number of leaves in a strictly binary tree is an odd number, then what can you say with full conviction about total number of nodes in the tree ?(A) It is an odd n...
3 3 votes
2 answers 2 answers
4.7k
4.7k views
How many numbers of binary tree can be created with 4 nodes which when traversed in post order gives the sequence D, C, B, A?1. 142. 153. 104. 16Please Explain.Is there a...
3 3 votes
2 2 answers
1.2k
1.2k views
Can somebody please list out the main advantages of B trees, B+ trees and Binary Search Trees over each other?
2 2 votes
1 answers 1 answer
1.0k
1.0k views
If a binary tree contains 1056 nodes the what is the height of binary tree??
1 1 vote
2 answers 2 answers
1.0k
1.0k views
The no. of binary trees with 3 nodes which when traversed by post-order gives the sequenceA, B, C is:(a) 3 (b) 9(c) 7 (d) 5
1 1 vote
1 1 answer
742
742 views
Q Consider a complete Binary Tree ‘T’ with key of root node be ‘P’. It is given that the left and right subtree of ‘P’ satisfies min-heap property. What is the time taken...
1 1 vote
2 answers 2 answers
1.3k
1.3k views
How many distinct binary tree can be formed with three distinct keys?Please help me to find the correct answer?
1 1 vote
1 1 answer
765
765 views
int A(struct node* node) { if (node==NULL) return 0; else { int lDepth = A(node->left); int rDepth = A(node->right); /* use the larger one */ if (lDepth rDepth) return(l...
0 0 votes
2 answers 2 answers
1.5k
1.5k views
The height of a binary tree having 'i' nodes at level 'i' considering root to be at level 1 is . where 'n' is the total no of nodes in the tree.A. O(logn)B. O(n)C. O(R...
0 0 votes
2 2 answers
583
583 views
Which of the following statements is FALSE?Optimal binary search tree construction can be performed efficiently using dynamic programming.Breadth-first search cannot be u...
1 1 vote
1 1 answer
717
717 views
An $m-ary$ tree is a tree in which every node has at most $m$ children. In an $m-ary$ tree with $p$ nodes and height $l$ $($starting from $0)$, which of the following is ...
9 9 votes
3 answers 3 answers
9.4k
9.4k views
 If the post order traversal gives ab -cd * + then the label of the nodes 1,2,3.. will be+ , -, *, a,b,c,da, -,b,+,c,*,da,b,c,d,-,*,+-,a,b,+,*,c,d