GATE Programming and Data Structures: Trees and Binary Search Trees – Previous Year Questions
20 GATE previous year questions on Trees and Binary Search Trees (Programming and Data Structures, Computer Science) with answers and explanations, from every paper.
- GATE 2017 CS Q16 – Let T be a binary search tree with 15 nodes. The minimum and maximum possible heights of T are: Note: The height of a tree with a single node is 0.
- GATE 2015 CS Q15 – 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 binary tree of height 5 are
- GATE 2015 CS Q17 – Which of the following is/are correct inorder traversal sequence(s) of binary search tree(s)? I. 3, 5, 7, 8, 15, 19, 25 II. 5, 8, 9, 12, 10, 15, 25…
- GATE 2015 CS Q35 – What are the worst-case complexities of insertion and deletion of a key in a binary search tree?
- GATE 2018 CS Q30 – 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,2,5,1,3. The height of a tree is…
- GATE 2026 CS (CS2) Q12 – The set T represents various traversals over a binary tree. The set S represents the order of visiting nodes during a traversal. I: Inorder II:…
- GATE 2026 CS (CS2) Q49 – Consider a binary search tree (BST) with n leaf nodes, where n>0. All keys are distinct real numbers. For a node V, let Suc(V) denote its inorder…
- GATE 2026 CS (CS1) Q33 – The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full…
- GATE 2026 CS (CS1) Q40 – Let P be the set of all integers from 1 to 15. Consider any order of insertion of the elements of P into a binary search tree that creates a complete…
- GATE 2026 CS (CS1) Q62 – The following sequence corresponds to the preorder traversal of a binary search tree T: 50, 25, 13, 40, 30, 47, 75, 60, 70, 80, 77 The position of the…
- GATE 2025 CS (CS2) Q13 – Consider a binary tree T in which every node has either zero or two children. Let n > 0 be the number of nodes in T. Which ONE of the following is the…
- GATE 2025 CS (CS2) Q35 – Suppose the values 10, -4, 15, 30, 20, 5, 60, 19 are inserted in that order into an initially empty binary search tree. Let T be the resulting binary…
- GATE 2025 CS (CS2) Q38 – A meld operation on two instances of a data structure combines them into one single instance of the same data structure. Consider the following data…
- GATE 2025 CS (CS1) Q26 – Which of the following statement(s) is/are TRUE for any binary search tree (BST) having n distinct integers?
- GATE 2024 CS (CS2) Q39 – You are given a set V of distinct integers. A binary search tree T is created by inserting all elements of V one by one, starting with an empty tree.…
- GATE 2023 CS Q47 – Consider the C function foo and the binary tree shown. [Figure: binary tree with root 10; left child 5 with children 3 and 8; right child 11 with…
- GATE 2021 CS Q20 – A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element…
- GATE 2020 CS Q15 – The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the postorder traversal of the tree?
- GATE 2020 CS Q16 – What is the worst case time complexity of inserting n2 elements into an AVL-tree with n elements initially?
- GATE 2020 CS Q51 – In a balanced binary search tree with n elements, what is the worst case time complexity of reporting all elements in range [a,b]? Assume that the…