Recent questions tagged binary-tree

0 0 votes
0 0 answers
661
661 views
Data Structure question: Binary tree question having four options involving no of internal nodes, leaf nodes, height etc.
2 2 votes
1 1 answer
946
946 views
Given the following table of observations, calculate the information gain $IG(Y |X)$ that would result from learning the value of $X$. XYRedTrueGreenFalseBrownFalseBrownF...
0 0 votes
0 0 answers
708
708 views
Find initial values of binary semaphores X and Y. P and V operation for counting semaphore b is defined as:P(b): b ; wait if b<0;V(b): b++; wakeup any waiting process in ...
1 1 vote
1 1 answer
586
586 views
Given below are two statements: one is labelled as Assertion $\mathrm{A}$ and the other is labelled as Reason $\mathrm{R}$.Assertion $\mathrm{A}$: The AVL trees are more ...
0 0 votes
0 0 answers
716
716 views
What is the smallest and largest number of entries for 2-3 BTree (B2-3 Tree) of height 8 (i.e., 8 levels) ?255 and 6560127 and 2186 6561 and 255255 and 2186
0 0 votes
1 1 answer
523
523 views
How many different trees are possible with ' $n$ ' nodes?$\mathrm{n}_{-1}$$2^{\mathrm{n}}-1$$2^{\mathrm{n}}$$2^{\mathrm{n}}-\mathrm{n}$(Option $1 [39397]) 1$(Option $2 [3...
0 0 votes
0 0 answers
572
572 views
The total number of binary trees possible with height n - 2 having n nodes are?(2n - 5)^ 2n - 3 (2n - 7)^2n - 3(n - 3) ^2n - 2(2n - 7)^ 2n - 2
0 0 votes
1 1 answer
1.8k
1.8k views
The total number of binary trees possible with height n - 2 having n nodes are?(2n - 5)^ 2n - 3 (2n - 7)^2n - 3(n - 3) ^2n - 2(2n - 7)^ 2n - 2
4 4 votes
2 2 answers
1.8k
1.8k views
Consider a perfect binary tree with $\mathrm{n}$ nodes and $\mathrm{h}$ height. A tree is perfect when all levels of the tree are completely full. Let root is at depth $0...
34 34 votes
6 6 answers
19.3k
19.3k views
Consider the $\text{C}$ function $\text{foo}$ and the binary tree shown.typedef struct node { int val; struct node *left, *right; } node; int foo(node *p) { int retval; i...
30 30 votes
5 5 answers
3.4k
3.4k views
A binary tree $\text{T}$ is full if either $\text{T}$ has one node, or the root of $\text{T}$ has two children which are roots of full binary trees. For instance, a full ...
0 0 votes
0 0 answers
507
507 views
Let n players enter a chess tournament. How many tournament trees are possible?RULES: a player is eliminated after one loss and games are played until only one entrant is...
0 0 votes
0 0 answers
636
636 views
1 1 vote
1 1 answer
813
813 views
Find the number of binary tree(s) with $3$ nodes (i.e., $\text{A, B,}$ and $\text{C})$ which when traversed by pre-order gives the sequence $\textbf{C B A}$. You also nee...
1 1 vote
2 2 answers
657
657 views
If the maximum height of a binary tree is $\mathrm{N},$ then how many number of nodes will there be?