1
GATE CSE 2004
MCQ (Single Correct Answer)
+2
-0.6
A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for each node x. If the cost of computing g(x) is min{ no. of leaf-nodes in left-subtree of x, no. of leaf-nodes in right-subtree of x } then the worst-case time complexity of the program is
A
$$\Theta (n)$$
B
$$\Theta (n \log n)$$
C
$$\Theta(n^2)$$
D
$$\Theta (n^2\log n)$$
2
GATE CSE 2002
MCQ (Single Correct Answer)
+2
-0.6
The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is:
A
n/2
B
(n-1)/3
C
(n-1)/2
D
(2n+1)/3
3
GATE CSE 2000
MCQ (Single Correct Answer)
+2
-0.6
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respectively, of a complete binary tree. Which of the following is always tree?
A
LASTIN = LASTPOST
B
LASTIN = LASTPRE
C
LASTPRE = LASTPOST
D
None of the above
4
GATE CSE 1998
MCQ (Single Correct Answer)
+2
-0.6
A complete n-ary tree is one in which every node has O or n sons. If x is the number of internal nodes of a complete n-ary tree, the number of leaves in it is given by
A
x(n – 1) +1
B
xn - 1
C
xn + 1
D
x(n+1)
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12