GATE Algorithms: Searching, Sorting and Hashing – Previous Year Questions
13 GATE previous year questions on Searching, Sorting and Hashing (Algorithms, Computer Science) with answers and explanations, from every paper.
- GATE 2017 CS Q58 – Let A be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index i such that…
- GATE 2016 CS Q23 – The worst case running times of Insertion sort, Merge sort and Quick sort, respectively, are:
- GATE 2015 CS Q14 – Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n ( 2) numbers? In the…
- GATE 2019 CS Q30 – An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that…
- GATE 2019 CS Q50 – Consider the following statements: I. The smallest element in a max-heap is always at a leaf node II. The second largest element in a max-heap is…
- GATE 2026 CS (CS2) Q30 – The keys 5, 28, 19, 15, 26, 33, 12, 17, and 10 are inserted into a hash table using the hash function h(k)=k 9. Collisions are resolved by chaining.…
- GATE 2026 CS (CS1) Q24 – Consider a hash table P[0, 1, , 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function…
- GATE 2025 CS (CS2) Q20 – Consider an unordered list of N distinct integers. What is the minimum number of element comparisons required to find an integer in the list that is…
- GATE 2025 CS (CS2) Q41 – An array A of length n with distinct elements is said to be bitonic if there is an index 1 i n such that A[1..i] is sorted in the non-decreasing order…
- GATE 2025 CS (CS1) Q33 – The pseudocode of a function fun() is given below: Let A[0,...,29] be an array storing 30 distinct integers in descending order. The number of swap…
- GATE 2023 CS Q20 – An algorithm has to store several keys generated by an adversary in a hash table. The adversary is malicious who tries to maximize the number of…
- GATE 2022 CS Q16 – Suppose we are given n keys, m hash table slots, and two simple uniform hash functions h 1 and h 2. Further suppose our hashing scheme uses h 1 for…
- GATE 2021 CS Q19 – Consider the following array: [23, 32, 45, 69, 72, 73, 89, 97]. Which algorithm out of the following options uses the least number of comparisons…