Skip to content

GATE CS Trees questions

Practise Trees questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2007Programming and Data StructuresTreesMCQ · 1 mark
A complete n−aryn-ary tree is a tree in which each node has nn children or no children. Let II be the number of internal nodes and LL be the number of leaves in a complete n−aryn-ary tree. If L=41L = 41 and I=10I = 10, what is the value of nn?
Official PYQ2007Programming and Data StructuresTreesMCQ · 1 mark
The inorder and preorder traversal of a binary tree are d b e a f c g\text{d b e a f c g} and a b d e c f g\text{a b d e c f g}, respectively The postorder traversal of the binary tree is:
Official PYQ2007Programming and Data StructuresTreesMCQ · 1 mark
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height hh is:
Official PYQ2007Programming and Data StructuresTreesMCQ · 1 mark
The maximum number of binary trees that can be formed with three unlabeled nodes is:
Official PYQ2006Programming and Data StructuresTreesMCQ · 1 mark
A scheme for storing binary trees in an array XX is as follows. Indexing of XX starts at 11 instead of 00. the root is stored at X[1]X[1]. For a node stored at X[i]X[i], the left child, if any, is stored in X[2i]X[2i] and the right child, if any, in X[2i+1]X[2i+1]. To be able to store any binary tree on n vertices the minimum size of XX should be
Official PYQ2005Programming and Data StructuresTreesMCQ · 1 mark
In a complete kk-ary tree, every internal node has exactly kk children. The number of leaves in such a tree with nn internal node is:
Official PYQ2005Programming and Data StructuresTreesMCQ · 1 mark
An Abstract Data Type (ADT) is:
Official PYQ2004Programming and Data StructuresTreesMCQ · 1 mark
Consider the following C program segment struct CellNode{ struct CellNode *leftChild int element; struct CellNode *rightChild; }; int Dosomething (struct CellNode *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 …
Official PYQ2004Programming and Data StructuresTreesMCQ · 1 mark
Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs identify a tree uniquely? preorder and postorder inorder and postorder preorder and inorder level order and postorder
Official PYQ2004Programming and Data StructuresTreesMCQ · 1 mark
Level order traversal of a rooted tree can be done by starting from the root and performing
Official PYQ2002Programming and Data StructuresTreesMCQ · 1 mark
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the furthest leaf) of such a tree on n nodes is best described by which of the following?
Official PYQ2002Programming and Data StructuresTreesMCQ · 1 mark
The number of leaf nodes in a rooted tree of n nodes, with each node having 00 or 33 children is:
Official PYQ2000Programming and Data StructuresTreesMCQ · 1 mark
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?
Official PYQ2000Programming and Data StructuresTreesMCQ · 1 mark
Consider the following nested representation of binary trees: (X Y Z)(X \ Y \ Z) indicates YY and ZZ are the left and right subtrees, respectively, of node XX. Note that YY and ZZ may be NULLNULL, or further nested. Which of the following represents a valid binary tree?
Official PYQ1998Programming and Data StructuresTreesMCQ · 1 mark
A complete nn-ary tree is one in which every node has 00 or nn sons. If xx is the number of internal nodes of a complete nn-ary tree, the number of leaves in it is given by
Official PYQ1998Programming and Data StructuresTreesMSQ · 1 mark
Which of the following statements is false?
Official PYQ1996Programming and Data StructuresTreesMCQ · 1 mark
Which of the following sequences denotes the post order traversal sequence of the below tree?
Official PYQ1996Programming and Data StructuresTreesMCQ · 1 mark
In the balanced binary tree in the below figure, how many nodes will become unbalanced when a node is inserted as a child of the node “g”?
Official PYQ1995Programming and Data StructuresTreesMCQ · 1 mark
A binary tree TT has nn leaf nodes. The number of nodes of degree 22 in TT is
Official PYQ1992Programming and Data StructuresTreesMSQ · 1 mark
A 2−32-3 tree is such that All internal nodes have either 22 or 33 children All paths from root to the leaves have the same length The number of internal nodes of a 2−32-3 tree having 99 leaves could be