Computer Science EngineeringHard
A binary tree has exactly 15 nodes with two children. How many leaves does it have?
- A. 15
- B. 16
- C. 14
- D. 31
Correct answer: B. 16
In any binary tree, leaves = (nodes with two children) + 1 = 16.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- The auxiliary space used by a recursive DFS on a graph with V vertices, in the worst case, is
- What does f(37) return for int f(int n){ if(n==0) return 0; return f(n/2) + (n%2); }
- How many structurally distinct binary trees exist with 5 nodes?
- Which of the following algorithms can detect a negative-weight cycle reachable from the source?
- The worst-case running time of the Rabin-Karp string matching algorithm (text length n, pattern length m) is
- What is the Theta bound for: for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<j;k++) c++;