NEW
New Website Launch
Experience the best way to solve previous year questions with mock tests (very detailed analysis), bookmark your favourite questions, practice etc...
VISIT NOW

GATE CSE

Trees

Data Structures

Previous Years Questions

Marks 1

More
Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree is stored using the ar...
GATE CSE 2022
What is the worst case time complexity of inserting n2 elements into an AVL-tree with n elements initially?
GATE CSE 2020
The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the post...
GATE CSE 2020
The postorder traversal of a binary tree is $$8,9,6,7,4,5,2,3,1.$$ The inorder traversal of the same tree is $$8,6,9,4,7...
GATE CSE 2018
While inserting the elements $$71, 65, 84, 69, 67, 83$$ in an empty binary search tree $$(BST)$$ in the sequence shown, ...
GATE CSE 2015 Set 3
Consider a binary tree $$T$$ that has $$200$$ leaf nodes. Then, the number of nodes in $$T$$ that have exactly two child...
GATE CSE 2015 Set 3
A binary tree $$T$$ has $$20$$ leaves. The number of nodes in $$T$$ having two children is _______________.
GATE CSE 2015 Set 2
Consider a complete binary tree where the left and the right sub-trees of the root are max-heaps. The lower bound for th...
GATE CSE 2015 Set 2
What are the worst-case complexities of insertion and deletion of a key in a binary search tree?
GATE CSE 2015 Set 1
Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)? I. 3, 5, 7, 8, 15, 19, 25 ...
GATE CSE 2015 Set 1
The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a ...
GATE CSE 2015 Set 1
Consider a rooted n node binary tree represented using pointers. The best upper bound on the time required to determine ...
GATE CSE 2014 Set 1
Consider the following rooted tree with the vertex labelled P as the root The order in which the nodes are visited duri...
GATE CSE 2014 Set 3
A max-heap is a heap where the value of each parent is greater than or equal to the value of its children. Which of the ...
GATE CSE 2011
Which of the following is TRUE?
GATE CSE 2008
The maximum number of binary trees that can be formed with three unlabeled nodes is:
GATE CSE 2007
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 bi...
GATE CSE 2007
In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The...
GATE CSE 2006
A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. the root is store...
GATE CSE 2006
The numbers 1, 2, ........, n are inserted in a binary search tree in some order. In the resulting tree, the right subtr...
GATE CSE 2005
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is...
GATE CSE 2004
Level order traversal of a rooted tree can be done by starting from the root and performing
GATE CSE 2004
Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. ...
GATE CSE 2003
Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right sub stres...
GATE CSE 2000
Which of the following statements is false?
GATE CSE 1998
In the balanced binary tree in Fig. given below, how many nodes will become unbalanced when a node is inserted as a chil...
GATE CSE 1996
Which of the following sequences denotes the post order traversal sequence of the tree of previous question?
GATE CSE 1996
A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is:
GATE CSE 1995
If the no of leaves in a tree is not a power of 2,then the tree is not a binary tree.
GATE CSE 1987
It is possible to construct a binary tree uniquely whose pre-order and post-order traversals are given.
GATE CSE 1987

Marks 2

More
Consider the following statements. S1 : The sequence of procedure calls corresponds to a preorder traversal of the acti...
GATE CSE 2021 Set 1
A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smal...
GATE CSE 2021 Set 1
Consider the array representation of a binary min-heap containing 1023 elements. The minimum number of comparisons requi...
GATE CSE 2020
In a balanced binary search tree with n elements, what is the worst case time complexity of reporting all elements in ra...
GATE CSE 2020
Let T be a full binary tree with 8 leaves. (A full binary tree has every level full). Suppose two leaves a and b of T ar...
GATE CSE 2019
The number of ways in which the numbers $$1, 2, 3, 4, 5, 6, 7$$ can be inserted in an empty binary search tree, such tha...
GATE CSE 2016 Set 2
Consider the following $$New-order$$ strategy for traversing a binary tree: $$\,\,\,\,\,\,\, \bullet \,\,\,\,\,$$ Visit...
GATE CSE 2016 Set 2
Suppose we have a balanced binary search tree T holding n numbers. We are given two numbers L and H and wish to sum up a...
GATE CSE 2014 Set 3
Consider the pseudocode given below. The function Dosomething () takes as argument a pointer to the root of an arbitrary...
GATE CSE 2014 Set 3
Consider the expression tree shown. Each leaf represents a numerical value, which can either be 0 or 1. Over all possibl...
GATE CSE 2014 Set 2
Consider the C function given below. Assume that the array listA contains n (> 0) elements, sored in ascending order....
GATE CSE 2014 Set 3
The height of a tree is defined as the number of edges on the longest path in the tree. The function shown in the pseudo...
GATE CSE 2012
We are given a set of n distinct elements and an unlabeled binary tree with n nodes. In how many ways can we populate th...
GATE CSE 2011
What is the maximum height of any AVL-tree with 7 nodes? Assume that the height of a tree with a single node is 0.
GATE CSE 2009
You are given the postorder traversal, P, of a binary search tree on the n elements 1, 2,..........., n. You have to det...
GATE CSE 2008
How many distinct BSTs can be constructed with 3 distinct keys?
GATE CSE 2008
A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys. I. 81, 537, 1...
GATE CSE 2008
A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys. I. 81, 537, ...
GATE CSE 2008
The following three are known to be the preorder, inorder and postorder sequences of a binary tree. But it is not known ...
GATE CSE 2008
A complete n-ary tree is a tree in which each node has n children or no children. Let I be the number of internal nodes ...
GATE CSE 2007
When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70 80, 90 a...
GATE CSE 2007
Consider the following C program segment where CellNode represents a node in a binary tree: struct CellNode { st...
GATE CSE 2007
The inorder and preorder traversal of a binary tree are d b e a f c g and a b d e c f g, respectively. The postorder tra...
GATE CSE 2007
An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array ...
GATE CSE 2006
An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array ...
GATE CSE 2006
An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array ...
GATE CSE 2006
Which of the following sequences of array elements forms a heap?
GATE CSE 2006
Suppose that we have numbers between 1 and 100 in a binary search tree and want to search for the number 55. Which of th...
GATE CSE 2006
A Priority-Queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is gi...
GATE CSE 2005
A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is traversed in pre-order and the values...
GATE CSE 2005
How many distinct binary search trees can be created out of 4 distinct keys?
GATE CSE 2005
In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2....
GATE CSE 2005
In a complete k-ary tree, every internal node has exactly k children. The number of leaves in such a tree with n interna...
GATE CSE 2005
Postorder traversal of a given binary search tree T produces the following sequence of keys 10, 9, 23, 22, 27, 25, 15, ...
GATE CSE 2005
A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for e...
GATE CSE 2004
Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pair...
GATE CSE 2004
Consider the following C program segment struct CellNode{ struct CellNode *leftChild; int element; struc...
GATE CSE 2004
The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is:
GATE CSE 2002
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respecti...
GATE CSE 2000
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-a...
GATE CSE 1998
A binary search tree contains the value 1, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the values are pr...
GATE CSE 1997
A binary search tree is used to locate the number 43. Which of the following probe sequences are not possible?
GATE CSE 1996
A binary search tree is generated by inserting in order the following integers: 50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60...
GATE CSE 1996
If the binary tree in figure is traversed in inorder, then the order in which the nodes will be visited is ______ ...
GATE CSE 1991

Joint Entrance Examination

JEE Main JEE Advanced WB JEE

Graduate Aptitude Test in Engineering

GATE CSE GATE ECE GATE EE GATE ME GATE CE GATE PI GATE IN

Medical

NEET

CBSE

Class 12