Level order traversal of a rooted tree can be done by starting from the root and performing
GATE CSE · Programming In C
Practice problems for Binary Tree in Programming in C.
50 questions · 10 PYQs · 0 AI practice · GATE CSE 2027
Level order traversal of a rooted tree can be done by starting from the root and performing
Consider the following C program segment struct CellNode { struct CelINode *leftchild; int element; struct CelINode *rightChild; }
int Dosomething(struct CelINode *ptr) {
int value = 0;
if (ptr != NULL) {
if (ptr->leftChild != NULL) value = 1 + DoSomething(ptr->leftChild);
if (ptr->rightChild != NULL) value = max(value, 1 + DoSomething(ptr->rightChild));
}
return (value);
}
The value returned by the function DoSomething when a pointer to the root of a non-empty tree is passed as argument is
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 true?
Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right subtrees, respectively, of node X. Note that Y and Z may be NULL, or further nested. Which of the following represents a valid binary tree?
Which of the following sequences denotes the post order traversal sequence of the below tree?

A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is
Which of the following statements is false?
Choose the correct alternatives (More than one may be correct). The number of rooted binary trees with n nodes is,
Choose the correct alternatives (More than one may be correct). The total external path length, EPL, of a binary tree with n external nodes is, , where is the path length of external node w),
Answer the following: Which one of the following statements (s) is/are FALSE?
Want unlimited AI-generated Binary Tree questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →